Browse Source

[docs] Taken off outdated info

Caue Waneck 12 years ago
parent
commit
b20b8c0795
1 changed files with 46 additions and 47 deletions
  1. 46 47
      std/Array.hx

+ 46 - 47
std/Array.hx

@@ -21,8 +21,7 @@
  */
  */
 /**
 /**
 	An Array is a storage for values. You can access it using indexes or
 	An Array is a storage for values. You can access it using indexes or
-	with its API. On the server side, it's often better to use a `List` which
-	is less memory and CPU consuming, unless you really need indexed access.
+	with its API.
 **/
 **/
 extern class Array<T> {
 extern class Array<T> {
 
 
@@ -39,14 +38,14 @@ extern class Array<T> {
 	/**
 	/**
 		Returns a new Array by appending the elements of `a` to the elements of
 		Returns a new Array by appending the elements of `a` to the elements of
 		`this` Array.
 		`this` Array.
-		
+
 		This operation does not modify `this` Array.
 		This operation does not modify `this` Array.
-		
+
 		If `a` is the empty Array `[]`, a copy of `this` Array is returned.
 		If `a` is the empty Array `[]`, a copy of `this` Array is returned.
-		
+
 		The length of the returned Array is equal to the sum of `this.length`
 		The length of the returned Array is equal to the sum of `this.length`
 		and `a.length`.
 		and `a.length`.
-		
+
 		If `a` is `null`, the result is unspecified.
 		If `a` is `null`, the result is unspecified.
 	**/
 	**/
 	function concat( a : Array<T> ) : Array<T>;
 	function concat( a : Array<T> ) : Array<T>;
@@ -54,25 +53,25 @@ extern class Array<T> {
 	/**
 	/**
 		Returns a string representation of `this` Array, with `sep` separating
 		Returns a string representation of `this` Array, with `sep` separating
 		each element.
 		each element.
-		
+
 		The result of this operation is equal to `Std.string(this[0]) + sep +
 		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])`
 		Std.string(this[1]) + sep + ... + sep + Std.string(this[this.length-1])`
-		
+
 		If `this` is the empty Array `[]`, the result is the empty String `""`.
 		If `this` is the empty Array `[]`, the result is the empty String `""`.
 		If `this` has exactly one element, the result is equal to a call to
 		If `this` has exactly one element, the result is equal to a call to
 		`Std.string(this[0])`.
 		`Std.string(this[0])`.
-		
+
 		If `sep` is null, the result is unspecified.
 		If `sep` is null, the result is unspecified.
 	**/
 	**/
 	function join( sep : String ) : String;
 	function join( sep : String ) : String;
 
 
 	/**
 	/**
 		Removes the last element of `this` Array and returns it.
 		Removes the last element of `this` Array and returns it.
-		
+
 		This operation modifies `this` Array in place.
 		This operation modifies `this` Array in place.
-		
+
 		If `this` has at least one element, `this.length` will decrease by 1.
 		If `this` has at least one element, `this.length` will decrease by 1.
-		
+
 		If `this` is the empty Array `[]`, null is returned and the length
 		If `this` is the empty Array `[]`, null is returned and the length
 		remains 0.
 		remains 0.
 	**/
 	**/
@@ -81,30 +80,30 @@ extern class Array<T> {
 	/**
 	/**
 		Adds the element `x` at the end of `this` Array and returns the new
 		Adds the element `x` at the end of `this` Array and returns the new
 		length of `this` Array.
 		length of `this` Array.
-		
+
 		This operation modifies `this` Array in place.
 		This operation modifies `this` Array in place.
-		
+
 		`this.length` increases by 1.
 		`this.length` increases by 1.
 	**/
 	**/
 	function push(x : T) : Int;
 	function push(x : T) : Int;
 
 
 	/**
 	/**
 		Reverse the order of elements of `this` Array.
 		Reverse the order of elements of `this` Array.
-		
+
 		This operation modifies `this` Array in place.
 		This operation modifies `this` Array in place.
-		
+
 		If `this.length < 2`, `this` remains unchanged.
 		If `this.length < 2`, `this` remains unchanged.
 	**/
 	**/
 	function reverse() : Void;
 	function reverse() : Void;
 
 
 	/**
 	/**
 		Removes the first element of `this` Array and returns it.
 		Removes the first element of `this` Array and returns it.
-		
+
 		This operation modifies `this` Array in place.
 		This operation modifies `this` Array in place.
-		
+
 		If `this` has at least one element, `this`.length and the index of each
 		If `this` has at least one element, `this`.length and the index of each
 		remaining element is decreased by 1.
 		remaining element is decreased by 1.
-		
+
 		If `this` is the empty Array `[]`, `null` is returned and the length
 		If `this` is the empty Array `[]`, `null` is returned and the length
 		remains 0.
 		remains 0.
 	**/
 	**/
@@ -113,18 +112,18 @@ extern class Array<T> {
 	/**
 	/**
 		Creates a shallow copy of the range of `this` Array, starting at and
 		Creates a shallow copy of the range of `this` Array, starting at and
 		including `pos`, up to but not including `end`.
 		including `pos`, up to but not including `end`.
-		
+
 		This operation does not modify `this` Array.
 		This operation does not modify `this` Array.
-		
+
 		The elements are not copied and retain their identity.
 		The elements are not copied and retain their identity.
-		
+
 		If `end` is omitted or exceeds `this.length`, it defaults to the end of
 		If `end` is omitted or exceeds `this.length`, it defaults to the end of
 		`this` Array.
 		`this` Array.
-		
+
 		If `pos` or `end` are negative, their offsets are calculated from the
 		If `pos` or `end` are negative, their offsets are calculated from the
 		end	of `this` Array by `this.length + pos` and `this.length + end`
 		end	of `this` Array by `this.length + pos` and `this.length + end`
 		respectively. If this yields a negative value, 0 is used instead.
 		respectively. If this yields a negative value, 0 is used instead.
-		
+
 		If `pos` exceeds `this.length` or if `end` exceeds or equals `pos`,
 		If `pos` exceeds `this.length` or if `end` exceeds or equals `pos`,
 		the result is `[]`.
 		the result is `[]`.
 	**/
 	**/
@@ -134,13 +133,13 @@ extern class Array<T> {
 		Sorts `this` Array according to the comparison function `f`, where
 		Sorts `this` Array according to the comparison function `f`, where
 		`f(x,y)` returns 0 if x == y, a positive Int if x > y and a
 		`f(x,y)` returns 0 if x == y, a positive Int if x > y and a
 		negative Int if x < y.
 		negative Int if x < y.
-		
+
 		This operation modifies `this` Array in place.
 		This operation modifies `this` Array in place.
-		
+
 		The sort operation is not guaranteed to be stable, which means that the
 		The sort operation is not guaranteed to be stable, which means that the
 		order of equal elements may not be retained. For a stable Array sorting
 		order of equal elements may not be retained. For a stable Array sorting
 		algorithm, `haxe.ds.sort.MergeSort.sort()` can be used instead.
 		algorithm, `haxe.ds.sort.MergeSort.sort()` can be used instead.
-		
+
 		If `f` is null, the result is unspecified.
 		If `f` is null, the result is unspecified.
 	**/
 	**/
 	function sort( f : T -> T -> Int ) : Void;
 	function sort( f : T -> T -> Int ) : Void;
@@ -148,20 +147,20 @@ extern class Array<T> {
 	/**
 	/**
 		Removes `len` elements from `this` Array, starting at and including
 		Removes `len` elements from `this` Array, starting at and including
 		`pos`, an returns them.
 		`pos`, an returns them.
-		
+
 		This operation modifies `this` Array in place.
 		This operation modifies `this` Array in place.
-		
+
 		If `len` is < 0 or `pos` exceeds `this`.length, the result is the empty
 		If `len` is < 0 or `pos` exceeds `this`.length, the result is the empty
 		Array [].
 		Array [].
-		
+
 		If `pos` is negative, its value is calculated from the end	of `this`
 		If `pos` is negative, its value is calculated from the end	of `this`
 		Array by `this.length + pos`. If this yields a negative value, 0 is
 		Array by `this.length + pos`. If this yields a negative value, 0 is
 		used instead.
 		used instead.
-		
+
 		If the sum of the resulting values for `len` and `pos` exceed
 		If the sum of the resulting values for `len` and `pos` exceed
 		`this.length`, this operation will affect the elements from `pos` to the
 		`this.length`, this operation will affect the elements from `pos` to the
 		end of `this` Array.
 		end of `this` Array.
-		
+
 		The length of the returned Array is equal to the new length of `this`
 		The length of the returned Array is equal to the new length of `this`
 		Array subtracted from the original length of `this` Array. In other
 		Array subtracted from the original length of `this` Array. In other
 		words, each element of the original `this` Array either remains in
 		words, each element of the original `this` Array either remains in
@@ -171,7 +170,7 @@ extern class Array<T> {
 
 
 	/**
 	/**
 		Returns a string representation of `this` Array.
 		Returns a string representation of `this` Array.
-		
+
 		The result will include the individual elements' String representations
 		The result will include the individual elements' String representations
 		separated by comma. The enclosing [ ] may be missing on some platforms,
 		separated by comma. The enclosing [ ] may be missing on some platforms,
 		use Std.string() to get a String representation that is consistent
 		use Std.string() to get a String representation that is consistent
@@ -181,26 +180,26 @@ extern class Array<T> {
 
 
 	/**
 	/**
 		Adds the element `x` at the start of `this` Array.
 		Adds the element `x` at the start of `this` Array.
-		
+
 		This operation modifies `this` Array in place.
 		This operation modifies `this` Array in place.
-		
+
 		`this.length` and the index of each Array element increases by 1.
 		`this.length` and the index of each Array element increases by 1.
 	**/
 	**/
 	function unshift( x : T ) : Void;
 	function unshift( x : T ) : Void;
 
 
 	/**
 	/**
 		Inserts the element `x` at the position `pos`.
 		Inserts the element `x` at the position `pos`.
-		
+
 		This operation modifies `this` Array in place.
 		This operation modifies `this` Array in place.
-		
+
 		The offset is calculated like so:
 		The offset is calculated like so:
-			
+
 		- If `pos` exceeds `this.length`, the offset is `this.length`.
 		- If `pos` exceeds `this.length`, the offset is `this.length`.
 		- If `pos` is negative, the offset is calculated from the end of `this`
 		- If `pos` is negative, the offset is calculated from the end of `this`
 		  Array, i.e. `this.length + pos`. If this yields a negative value, the
 		  Array, i.e. `this.length + pos`. If this yields a negative value, the
 		  offset is 0.
 		  offset is 0.
 		- Otherwise, the offset is `pos`.
 		- Otherwise, the offset is `pos`.
-		
+
 		If the resulting offset does not exceed `this.length`, all elements from
 		If the resulting offset does not exceed `this.length`, all elements from
 		and including that offset to the end of `this` Array are moved one index
 		and including that offset to the end of `this` Array are moved one index
 		ahead.
 		ahead.
@@ -209,13 +208,13 @@ extern class Array<T> {
 
 
 	/**
 	/**
 		Removes the first occurence of `x` in `this` Array.
 		Removes the first occurence of `x` in `this` Array.
-		
+
 		This operation modifies `this` Array in place.
 		This operation modifies `this` Array in place.
-		
+
 		If `x` is found by checking standard equality, it is removed from `this`
 		If `x` is found by checking standard equality, it is removed from `this`
 		Array and all following elements are reindexed acoordingly. The function
 		Array and all following elements are reindexed acoordingly. The function
 		then returns true.
 		then returns true.
-		
+
 		If `x` is not found, `this` Array is not changed and the function
 		If `x` is not found, `this` Array is not changed and the function
 		returns false.
 		returns false.
 	**/
 	**/
@@ -223,7 +222,7 @@ extern class Array<T> {
 
 
 	/**
 	/**
 		Returns a shallow copy of `this` Array.
 		Returns a shallow copy of `this` Array.
-		
+
 		The elements are not copied and retain their identity, so
 		The elements are not copied and retain their identity, so
 		`a[i] == a.copy()[i]` is true for any valid `i`. However,
 		`a[i] == a.copy()[i]` is true for any valid `i`. However,
 		`a == a.copy()` is always false.
 		`a == a.copy()` is always false.
@@ -237,19 +236,19 @@ extern class Array<T> {
 
 
 	/**
 	/**
 		Creates a new Array by applying function `f` to all elements of `this`.
 		Creates a new Array by applying function `f` to all elements of `this`.
-		
+
 		The order of elements is preserved.
 		The order of elements is preserved.
-		
+
 		If `f` is null, the result is unspecified.
 		If `f` is null, the result is unspecified.
 	**/
 	**/
 	function map<S>( f : T -> S ) : Array<S>;
 	function map<S>( f : T -> S ) : Array<S>;
-	
+
 	/**
 	/**
 		Returns an Array containing those elements of `this` for which `f`
 		Returns an Array containing those elements of `this` for which `f`
 		returned true.
 		returned true.
 
 
 		The individual elements are not duplicated and retain their identity.
 		The individual elements are not duplicated and retain their identity.
-		
+
 		If `f` is null, the result is unspecified.
 		If `f` is null, the result is unspecified.
 	**/
 	**/
 	function filter( f : T -> Bool ) : Array<T>;
 	function filter( f : T -> Bool ) : Array<T>;