Vector.hx 1019 B

12345678910111213141516171819202122232425262728293031323334
  1. package flash;
  2. /**
  3. The Vector class is very similar to Array but is only supported by the Flash Player 10+
  4. **/
  5. @:require(flash10) extern class Vector<T> implements ArrayAccess<T> {
  6. var length : UInt;
  7. var fixed : Bool;
  8. function new( ?length : UInt, ?fixed : Bool ) : Void;
  9. function concat( ?a : Vector<T> ) : Vector<T>;
  10. function join( sep : String ) : String;
  11. function pop() : Null<T>;
  12. function push(x : T) : Int;
  13. function reverse() : Void;
  14. function shift() : Null<T>;
  15. function unshift( x : T ) : Void;
  16. function slice( pos : Int, ?end : Int ) : Vector<T>;
  17. function sort( f : T -> T -> Int ) : Void;
  18. function splice( pos : Int, len : Int ) : Vector<T>;
  19. function toString() : String;
  20. function indexOf( x : T, ?from : Int ) : Int;
  21. function lastIndexOf( x : T, ?from : Int ) : Int;
  22. public inline static function ofArray<T>( v : Array<T> ) : Vector<T> {
  23. return untyped __vector__(v);
  24. }
  25. public inline static function convert<T,U>( v : Vector<T> ) : Vector<U> {
  26. return untyped __vector__(v);
  27. }
  28. }