All Bundles
Vector<H>
Growable array of generics
Operations
New
Default constructor
New()
Copy constructor
New(values:H[])
Parameters
Name | Type | Description |
---|
values | H | values to copy |
Copy constructor
New(values:Vector<H>)
Parameters
Name | Type | Description |
---|
values | Vector<H> | values to copy |
AddBack
Adds a vector of values to the end of the vector
method : public : AddBack(values:Vector<H>) ~ Nil
Parameters
Name | Type | Description |
---|
values | Vector<H> | values to append |
Adds a value to the end
method : public : AddBack(value:H) ~ Nil
Parameters
Name | Type | Description |
---|
value | H | value to append |
Compress
Compresses the Vector freeing unused memory
method : public : Compress() ~ Nil
Each
Function called for each element
method : public : Each(f:(H)~Nil) ~ Vector<H>
Parameters
Name | Type | Description |
---|
f | (H)~Nil | function called |
Empty
Clears the vector
method : public : Empty() ~ Nil
Get
Gets an indexed value
method : public : Get(index:Int) ~ H
Parameters
Name | Type | Description |
---|
index | Int | index |
Return
IsEmpty
Checks to see if the vector is empty
method : public : IsEmpty() ~ Bool
Return
Type | Description |
---|
Bool | true if empty, false otherwise |
Limit
Returns a limited list
method : public : Limit(l:Int) ~ Vector<H>
Parameters
Name | Type | Description |
---|
l | Int | limit |
Return
Type | Description |
---|
Vector<H> | limited list |
Map
Maps the given function to each value in the vector
method : public : Map(f:(H)~H) ~ Vector<H>
Parameters
Name | Type | Description |
---|
f | (H)~H | function to apply |
Return
Type | Description |
---|
Vector<H> | newly calculated vector |
Remove
Removes an indexed value
method : public : Remove(i:Int) ~ H
Parameters
Name | Type | Description |
---|
i | Int | index |
Return
RemoveBack
Removes the last value
method : public : RemoveBack() ~ H
Return
Set
Sets an indexed value
method : public : Set(value:H, index:Int) ~ Bool
Parameters
Name | Type | Description |
---|
value | H | value |
index | Int | index |
Size
Size of vector
method : public : Size() ~ Int
Return
Type | Description |
---|
Int | size of vector |
Swap
Swap two values in the vector
method : public : Swap(a:Int, b:Int) ~ Bool
Parameters
Name | Type | Description |
---|
a | Int | first value |
b | Int | second value |
Return
Type | Description |
---|
Bool | true if values were swapped |
ToArray
Converts the vector into an object array
method : public : ToArray() ~ H[]
Return
Type | Description |
---|
H | object array |