Utility class for modifying NativeArray objects

Static methods

@:has_untypedstaticinlinealloc<T> (len:Int):NativeArray<T>

Allocates an array with length len.

staticbinarySearchCmp<T> (a:NativeArray<T>, val:T, min:Int, max:Int, cmp:T ‑> T ‑> Int):Int

Searches the sorted array a for val in the range [min, max] using the binary search algorithm.

Returns:

the array index storing val or the bitwise complement (~) of the index where val would be inserted (guaranteed to be a negative number).
The insertion point is only valid for min = 0 and max = a.length - 1.

staticbinarySearchf (a:NativeArray<Float>, val:Float, min:Int, max:Int):Int

Searches the sorted array a for val in the range [min, max] using the binary search algorithm.

Returns:

the array index storing val or the bitwise complement (~) of the index where val would be inserted (guaranteed to be a negative number).
The insertion point is only valid for min = 0 and max = a.length - 1.

staticbinarySearchi (a:NativeArray<Int>, val:Int, min:Int, max:Int):Int

Searches the sorted array a for val in the range [min, max] using the binary search algorithm.

Returns:

the array index storing val or the bitwise complement (~) of the index where val would be inserted (guaranteed to be a negative number).
The insertion point is only valid for min = 0 and max = a.length - 1.

staticblit<T> (src:NativeArray<T>, srcPos:Int, dst:NativeArray<T>, dstPos:Int, n:Int):Void

Copies n elements from src, beginning at srcPos to dst, beginning at dstPos.

Copying takes place as if an intermediate buffer was used, allowing the destination and source to overlap.

staticinlinecopy<T> (src:NativeArray<T>):NativeArray<T>

Returns a shallow copy of src.

staticinlineget<T> (src:NativeArray<T>, index:Int):T

Returns the value in src at index.

@:value({ n : 0, first : 0 })staticinit<T> (a:NativeArray<T>, val:T, first:Int = 0, n:Int = 0):NativeArray<T>

Sets n elements in a to val starting at index first and returns a. If n is 0, n is set to the length of a.

@:value({ n : 0, first : 0 })staticnullify<T> (a:NativeArray<T>, first:Int = 0, n:Int = 0):NativeArray<T>

Nullifies n elements in a starting at index first and returns a. If n is 0, n is set to the length of a.

staticinlineofArray<T> (src:Array<T>):NativeArray<T>

Returns a NativeArray object from the values stored in src.

staticinlineset<T> (dst:NativeArray<T>, index:Int, val:T):Void

Sets the value in src at index to val.

staticinlinesize<T> (a:NativeArray<T>):Int

Returns the number of values in a.

statictoArray<T> (src:NativeArray<T>, first:Int, len:Int, dst:Array<T>):Array<T>

Copies n elements from src beginning at first to dst and returns dst.

@:value({ n : 0, first : 0 })staticinlinezero<T> (dst:NativeArray<T>, first:Int = 0, n:Int = 0):NativeArray<T>

Sets n elements in dst to 0 starting at index first and returns dst. If n is 0, n is set to the length of dst.