|
@@ -3,6 +3,12 @@ package haxe.ds;
|
|
|
private typedef VectorData<T> = java.NativeArray<T>
|
|
|
|
|
|
abstract Vector<T>(VectorData<T>) {
|
|
|
+ public var length(get, never):Int;
|
|
|
+
|
|
|
+ inline function get_length():Int {
|
|
|
+ return this.length;
|
|
|
+ }
|
|
|
+
|
|
|
extern overload public inline function new(length:Int) {
|
|
|
this = new java.NativeArray(length);
|
|
|
}
|
|
@@ -15,6 +21,14 @@ abstract Vector<T>(VectorData<T>) {
|
|
|
// trace("uncomment me");
|
|
|
}
|
|
|
|
|
|
+ @:op([]) public inline function get(index:Int):T {
|
|
|
+ return this[index];
|
|
|
+ }
|
|
|
+
|
|
|
+ @:op([]) public inline function set(index:Int, val:T):T {
|
|
|
+ return this[index] = val;
|
|
|
+ }
|
|
|
+
|
|
|
public static function blit<T>(src:Vector<T>, srcPos:Int, dest:Vector<T>, destPos:Int, len:Int):Void {}
|
|
|
|
|
|
static public function fromData<T>(data:VectorData<T>):Vector<T>
|