A Vector is a storage of fixed size. It can be faster than Array on some targets, and is never slower.

See also:

Static variables

staticread onlylength:Int

Returns the length of this Vector.

Static methods

@:op([])staticinlineget(this:VectorData<T>, index:Int):T

Returns the value at index index.

If index is negative or exceeds this.length, the result is unspecified.

@:op([])staticinlineset(this:VectorData<T>, index:Int, val:T):T

Sets the value at index index to val.

If index is negative or exceeds this.length, the result is unspecified.

staticblit<T>(src:Vector<T>, srcPos:Int, dest:Vector<T>, destPos:Int, len:Int):Void

Copies length of elements from src Vector, beginning at srcPos to dest Vector, beginning at destPos

The results are unspecified if length results in out-of-bounds access, or if src or dest are null

staticinlinecopy<T>(this:VectorData<T>):Vector<T>

Returns a shallow copy of this Vector.

The elements are not copied and retain their identity, so a[i] == a.copy()[i] is true for any valid i. However, a == a.copy() is always false.

staticinlinefill(this:VectorData<T>, value:T):Void

Available on clay native, unity

Sets all length elements of this Vector to value.

staticinlinetoData(this:VectorData<T>):VectorData<T>

Available on clay native

Extracts the data of this Vector.

This returns the internal representation type.

staticinlinejoin<T>(this:VectorData<T>, sep:String):String

Available on unity

Returns a string representation of this Vector, with sep separating each element.

The result of this operation is equal to Std.string(this[0]) + sep + Std.string(this[1]) + sep + ... + sep + Std.string(this[this.length-1])

If this Vector has length 0, the result is the empty String "". If this has exactly one element, the result is equal to a call to Std.string(this[0]).

If sep is null, the result is unspecified.

staticinlinemap<S>(this:VectorData<T>, f:T ‑> S):Vector<S>

Available on unity

Creates a new Vector by applying function f to all elements of this.

The order of elements is preserved.

If f is null, the result is unspecified.