class · System

Array

public class System.Array : System.Any
Kind
class
Namespace
System
Assembly
System.Core
Access
public, static, abstract
Source file
Array.ant

Inheritance

Base classes
Any Array

Methods

static method Sum<T>(items: T[], start: i32, count: i32) -> T
#

static

The total of a run of numbers (0 when empty).

static method Sum<T>(items: T[]) -> T
#

static

static method Min<T>(items: T[], start: i32, count: i32) -> T
#

static

The smallest of a run of numbers; the run must not be empty.

static method Min<T>(items: T[]) -> T
#

static

static method Max<T>(items: T[], start: i32, count: i32) -> T
#

static

The largest of a run of numbers; the run must not be empty.

static method Max<T>(items: T[]) -> T
#

static

static method Average<T>(items: T[]) -> f64
#

static

static method Equals(a: u8[], b: u8[]) -> bool
#

static

Whether a and b hold the same bytes (== on arrays compares identity); one comparison in memory.

static method Copy<T>(source: T[], sourceIndex: i32, target: T[], targetIndex: i32, length: i32) -> void
#

static

Copies length items from source[sourceIndex..] to target[targetIndex..] (overlapping ranges too).

static method Resize<T>(items: T[], length: i32) -> T[]
#

static

A new array with the first length items (and default values past the end of items).

static method Fill<T>(items: T[], value: T) -> void
#

static

static method Reverse<T>(items: T[]) -> void
#

static

static method IndexOf<T>(items: T[], value: T) -> i32
#

static

Where value first is (by Equals), or -1.

static method Sort(items: i32[], start: i32, count: i32) -> void
#

static

Sorts count integers from start: by their bytes when there are enough of them (no comparisons to mispredict).

static method Sort(items: i32[]) -> void
#

static

static method Sort(items: u32[], start: i32, count: i32) -> void
#

static

Sorts count integers from start: by their bytes when there are enough of them (no comparisons to mispredict).

static method Sort(items: u32[]) -> void
#

static

static method Sort(items: i64[], start: i32, count: i32) -> void
#

static

Sorts count integers from start: by their bytes when there are enough of them (no comparisons to mispredict).

static method Sort(items: i64[]) -> void
#

static

static method Sort(items: u64[], start: i32, count: i32) -> void
#

static

Sorts count integers from start: by their bytes when there are enough of them (no comparisons to mispredict).

static method Sort(items: u64[]) -> void
#

static

static method Sort<T>(items: T[]) -> void
#

static

Sorts the items in place (by CompareTo; not stable).

static method Sort<T>(items: T[], start: i32, count: i32) -> void
#

static

Sorts count items from start.

static method Sort<T>(items: T[], order: func<T, T> : i32) -> void
#

static

Sorts the items in place by order (negative: a goes first; not stable).

static method Sort<T>(items: T[], start: i32, count: i32, order: func<T, T> : i32) -> void
#

static

Sorts count items from start by order.

static method FindIndex<T>(items: T[], match: func<T> : bool) -> i32
#

static

Where the first item that match accepts is, or -1.

static method Exists<T>(items: T[], match: func<T> : bool) -> bool
#

static

Whether some item is accepted by match.

static method TrueForAll<T>(items: T[], match: func<T> : bool) -> bool
#

static

Whether every item is accepted by match.

static method ForEach<T>(items: T[], action: func<T> : void) -> void
#

static

Runs action on each item, in order.

static method ConvertAll<T, R>(items: T[], convert: func<T> : R) -> R[]
#

static

A new array with convert of each item.

static method BinarySearch<T>(items: T[], value: T) -> i32
#

static

Where value is in sorted items, or the bitwise complement of where it would go.

Private and internal members (13)

static constant RadixFrom: i32
#

private

From how many integers a sort goes by bytes (below, the passes over the counts cost more than comparing).

static method InsertionSort<T>(items: T[], low: i32, high: i32) -> void
#

private static

Insertion sort of items[low..high] (inclusive).

static method Swap<T>(items: T[], a: i32, b: i32) -> void
#

private static

static method SiftDown<T>(items: T[], low: i32, root: i32, count: i32) -> void
#

private static

static method HeapSort<T>(items: T[], low: i32, high: i32) -> void
#

private static

static method IntroSort<T>(items: T[], low: i32, high: i32, depth: i32) -> void
#

private static

static method RadixSort32(data: u32*, count: i32, flip: u32) -> void
#

private static

Integers of 32 bits sorted by their bytes, the lowest first (flip 128 on the top byte puts the negative ones first): each pass counts the bytes and places the items, without comparing them; a pass where every item has the same byte is skipped. Both arrays stay where they are meanwhile (an address taken inside one pins it).

static method RadixSort64(data: u64*, count: i32, flip: u64) -> void
#

private static

Integers of 64 bits sorted by their bytes, the lowest first (flip 128 on the top byte puts the negative ones first): each pass counts the bytes and places the items, without comparing them; a pass where every item has the same byte is skipped. Both arrays stay where they are meanwhile (an address taken inside one pins it).

static method InsertionSortBy<T>(items: T[], low: i32, high: i32, order: func<T, T> : i32) -> void
#

private static

static method SiftDownBy<T>(items: T[], low: i32, root: i32, count: i32, order: func<T, T> : i32) -> void
#

private static

static method HeapSortBy<T>(items: T[], low: i32, high: i32, order: func<T, T> : i32) -> void
#

private static

static method IntroSortBy<T>(items: T[], low: i32, high: i32, depth: i32, order: func<T, T> : i32) -> void
#

private static

static method Depth(count: i32) -> i32
#

private static

Inherited members (5)

Source

Array as Larva HIR, decompiled from its Larva HIR.

System.Array.hir
public class System.Array : System.Any
{
    // From how many integers a sort goes by bytes (below, the passes over the counts cost more than comparing).
    static constant RadixFrom: i32
    // Insertion sort of items[low..high] (inclusive).
    static method InsertionSort<T>(items: T[], low: i32, high: i32) -> void
    static method Swap<T>(items: T[], a: i32, b: i32) -> void
    static method SiftDown<T>(items: T[], low: i32, root: i32, count: i32) -> void
    static method HeapSort<T>(items: T[], low: i32, high: i32) -> void
    static method IntroSort<T>(items: T[], low: i32, high: i32, depth: i32) -> void
    // Integers of 32 bits sorted by their bytes, the lowest first (`flip` 128 on the top byte puts the negative ones
    // first): each pass counts the bytes and places the items, without comparing them; a pass where every item has
    // the same byte is skipped. Both arrays stay where they are meanwhile (an address taken inside one pins it).
    static method RadixSort32(data: u32*, count: i32, flip: u32) -> void
    // Integers of 64 bits sorted by their bytes, the lowest first (`flip` 128 on the top byte puts the negative ones
    // first): each pass counts the bytes and places the items, without comparing them; a pass where every item has
    // the same byte is skipped. Both arrays stay where they are meanwhile (an address taken inside one pins it).
    static method RadixSort64(data: u64*, count: i32, flip: u64) -> void
    static method InsertionSortBy<T>(items: T[], low: i32, high: i32, order: func<T, T> : i32) -> void
    static method SiftDownBy<T>(items: T[], low: i32, root: i32, count: i32, order: func<T, T> : i32) -> void
    static method HeapSortBy<T>(items: T[], low: i32, high: i32, order: func<T, T> : i32) -> void
    static method IntroSortBy<T>(items: T[], low: i32, high: i32, depth: i32, order: func<T, T> : i32) -> void
    static method Depth(count: i32) -> i32
    // The total of a run of numbers (0 when empty).
    static method Sum<T>(items: T[], start: i32, count: i32) -> T
    static method Sum<T>(items: T[]) -> T
    // The smallest of a run of numbers; the run must not be empty.
    static method Min<T>(items: T[], start: i32, count: i32) -> T
    static method Min<T>(items: T[]) -> T
    // The largest of a run of numbers; the run must not be empty.
    static method Max<T>(items: T[], start: i32, count: i32) -> T
    static method Max<T>(items: T[]) -> T
    static method Average<T>(items: T[]) -> f64
    // Whether `a` and `b` hold the same bytes (`==` on arrays compares identity); one comparison in memory.
    static method Equals(a: u8[], b: u8[]) -> bool
    // Copies `length` items from source[sourceIndex..] to target[targetIndex..] (overlapping ranges too).
    static method Copy<T>(source: T[], sourceIndex: i32, target: T[], targetIndex: i32, length: i32) -> void
    // A new array with the first `length` items (and default values past the end of `items`).
    static method Resize<T>(items: T[], length: i32) -> T[]
    static method Fill<T>(items: T[], value: T) -> void
    static method Reverse<T>(items: T[]) -> void
    // Where `value` first is (by Equals), or -1.
    static method IndexOf<T>(items: T[], value: T) -> i32
    // Sorts `count` integers from `start`: by their bytes when there are enough of them (no comparisons to mispredict).
    static method Sort(items: i32[], start: i32, count: i32) -> void
    static method Sort(items: i32[]) -> void
    // Sorts `count` integers from `start`: by their bytes when there are enough of them (no comparisons to mispredict).
    static method Sort(items: u32[], start: i32, count: i32) -> void
    static method Sort(items: u32[]) -> void
    // Sorts `count` integers from `start`: by their bytes when there are enough of them (no comparisons to mispredict).
    static method Sort(items: i64[], start: i32, count: i32) -> void
    static method Sort(items: i64[]) -> void
    // Sorts `count` integers from `start`: by their bytes when there are enough of them (no comparisons to mispredict).
    static method Sort(items: u64[], start: i32, count: i32) -> void
    static method Sort(items: u64[]) -> void
    // Sorts the items in place (by CompareTo; not stable).
    static method Sort<T>(items: T[]) -> void
    // Sorts `count` items from `start`.
    static method Sort<T>(items: T[], start: i32, count: i32) -> void
    // Sorts the items in place by `order` (negative: a goes first; not stable).
    static method Sort<T>(items: T[], order: func<T, T> : i32) -> void
    // Sorts `count` items from `start` by `order`.
    static method Sort<T>(items: T[], start: i32, count: i32, order: func<T, T> : i32) -> void
    // Where the first item that `match` accepts is, or -1.
    static method FindIndex<T>(items: T[], match: func<T> : bool) -> i32
    // Whether some item is accepted by `match`.
    static method Exists<T>(items: T[], match: func<T> : bool) -> bool
    // Whether every item is accepted by `match`.
    static method TrueForAll<T>(items: T[], match: func<T> : bool) -> bool
    // Runs `action` on each item, in order.
    static method ForEach<T>(items: T[], action: func<T> : void) -> void
    // A new array with `convert` of each item.
    static method ConvertAll<T, R>(items: T[], convert: func<T> : R) -> R[]
    // Where `value` is in sorted `items`, or the bitwise complement of where it would go.
    static method BinarySearch<T>(items: T[], value: T) -> i32
}
Esc