→ home
→ index of namespace default
→ index of project core
→ index of module coreClass core.ValueArray
Synopsis: An array of dynamically typed script values.
Base classes:
Methods:
alloc(int max) : boolean - Allocate the given number of array elements.
containsObject(Object o) : boolean - Check whether array contains an object that equals the given object.
containsPointer(Object o) : boolean - Check whether array contains the given object address.
empty() - Reset number of elements.
free() - Free all array elements.
get(int index) : var - Return the given array element.
getDeref(int index) : var - Return the given (deletable) array element.
getFirst() : var - Return first array element.
getLast() : var - Return last used array element.
getMaxElements() : int - Return the total number of elements.
getNumElements() : int - Return the number of used elements, numElements.
getString() : String - Return a string representation of this array.
indexOfObject(Object o) : int - Return the index of the element that equals the given object.
indexOfPointer(Object o) : int - Return the index of the element that points to the given object.
realloc(int max) : boolean - Resize array.
reverse() - Reverse element order
setNumElements(int num) - Set the number of used elements.
swap(int indexB) : boolean - Swap two array elements.
useAll() - Mark all array elements used, i.e. set numElements = maxElements.
See also:
Method alloc | |
Allocate the given number of array elements. |
Signature |
|
Arguments |
| int | max | | Total number of elements to allocate |
|
Returns |
| boolean | | true when the allocation succeeded, false otherwise. |
|
See also:
→ top of page
Method containsObject | |
Check whether array contains an object that equals the given object. |
Signature |
| containsObject | ( | Object | o | ) |
| | : | boolean |
|
Arguments |
|
Returns |
| boolean | | true if a matching object was found, false otherwise. |
|
See also:
→ top of page
Method containsPointer | |
Check whether array contains the given object address. |
Signature |
| containsPointer | ( | Object | o | ) |
| | : | boolean |
|
Arguments |
| Object | o | | The object (address) to compare with. |
|
Returns |
| boolean | | true if a matching object was found, false otherwise. |
|
See also:
→ top of page
Method empty | |
Reset number of elements. |
Signature |
|
See also:
→ top of page
Method free | |
Free all array elements. |
Signature |
|
See also:
→ top of page
Method get | |
Return the given array element. |
Signature |
|
Arguments |
| int | index | | Which array element to return |
|
Returns |
| var | | element value (non-deletable reference if the element holds an Object) |
|
Description |
Silently return void if the given index is out of bounds. |
See also:
→ top of page
Method getDeref | |
Return the given (deletable) array element. |
Signature |
|
Arguments |
| int | index | | Which array element to return |
|
Returns |
| var | | element value (deletable reference if the elements holds an Object) |
|
Description |
Silently return void if the given index is out of bounds. |
See also:
→ top of page
Method getFirst | |
Return first array element. |
Signature |
|
Returns |
| var | | First array element or void if the array is empty. Objects are returned as non-deletable references. |
|
→ top of page
Method getLast | |
Return last used array element. |
Signature |
|
Returns |
| var | | Last used array element (numElements - 1) or void if the array is empty. Objects are returned as non-deletable references. |
|
→ top of page
Method getMaxElements | |
Return the total number of elements. |
Signature |
|
Returns |
| int | | Total number of elements |
|
See also:
→ top of page
Method getNumElements | |
Return the number of used elements, numElements. |
Signature |
|
Returns |
| int | | Number of used elements |
|
See also:
→ top of page
Method getString | |
Return a string representation of this array. |
Signature |
|
Returns |
| String | | new String instance holding a string representation of this array. |
|
→ top of page
Method indexOfObject | |
Return the index of the element that equals the given object. |
Signature |
|
Arguments |
| Object | o | | The object to look for |
|
Returns |
| int | | Array index or -1 if no matching object was found in this array |
|
See also:
→ top of page
Method indexOfPointer | |
Return the index of the element that points to the given object. |
Signature |
|
Arguments |
| Object | o | | The object pointer to look for |
|
Returns |
| int | | Array index or -1 if the object address was not found in this array |
|
See also:
→ top of page
Method realloc | |
Resize array. |
Signature |
|
Arguments |
| int | max | | New total number of elements |
|
Returns |
| boolean | | true when the reallocation succeeded, false otherwise. |
|
Description |
Elements will be discarded/added as required. |
See also:
→ top of page
Method reverse | |
Reverse element order |
Signature |
|
→ top of page
Method setNumElements | |
Set the number of used elements. |
Signature |
|
Arguments |
| int | num | | New number of used elements |
|
See also:
→ top of page
Method swap | |
Swap two array elements. |
Signature |
|
Arguments |
| int | indexB | | Index of second element |
|
Returns |
| boolean | | true if the elements have been swapped successfully, false otherwise. |
|
→ top of page
Method useAll | |
Mark all array elements used, i.e. set numElements = maxElements. |
Signature |
|
→ top of page
| Project Modules: | core |
| Project Classes: | Boolean , Buffer , Byte , Class , ClassArray , Condition , Configuration , Double , Envelope , Event , Exception , File , Float , FloatArray , FloatArray128 , FloatArray16 , FloatArray32 , FloatArray64 , FloatArray8 , Function , HashTable , IntArray , IntArray128 , IntArray16 , IntArray32 , IntArray64 , IntArray8 , Integer , List , ListNode , Long , Mailbox , Mutex , Object , ObjectArray , PakFile , PointerArray , Pool , Script , SharedBuffer , Short , Stack , StdErrStream , StdInStream , StdOutStream , Stream , String , String128 , String16 , String32 , String64 , String8 , StringArray , StringIterator , Thread , Time , TKS , TreeNode , UnsignedByte , UnsignedInteger , UnsignedLong , UnsignedShort , Value , ValueArray , Variable |
| Project Functions: | ceil , exit , floor , GetCurrentThread , getenv , lcchar , mathAbsMaxf , mathAbsMinf , mathAbsMini , mathAbsMini , mathClampf , mathDistancePointPlane2d , mathLerpf , mathMaxf , mathMaxi , mathMinf , mathMini , mathPowerf , mathPoweri , mathSmoothStepf , mathWrapf , milliSeconds , psystem , putenv , srand , system , ucchar |
| All Namespaces: | default , ui |
| All Projects: | core , debugtext , tkfreetype2 , tkmath , tkmidi , tkopengl , tkportaudio , tksdl , tkui , tkunit |
auto-generated by "DOG", the TkScript document generator. Sat, 31/Dec/2011 16:12:19