class NativeArrayTools
package de.polygonal.ds.tools
Utility class for modifying NativeArray objects
Static methods
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.
staticinit<T> (a:NativeArray<T>, val:T, ?first:Int, ?n:Int):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.
staticnullify<T> (a:NativeArray<T>, ?first:Int, ?n:Int):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.
staticinline ofArray<T> (src:Array<T>):NativeArray<T>
Returns a NativeArray object from the values stored in src.
staticinline set<T> (dst:NativeArray<T>, index:Int, val:T):Void
Sets the value in src at index to val.
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.
staticinline zero<T> (dst:NativeArray<T>, ?first:Int, ?n:Int):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.