home
 
 index of namespace default
 
 index of project core
 
 index of module core

Class core.ClassArray


SynopsisArray of scriptclass instances.

  Base classes:
  Methods: See also:  


Method add
Add the given scriptclass instance to this array.
Signature
add(Classc)
 :boolean
Arguments
ClasscScriptclass instance to add. If c is a Value object, try to release the scriptclass instance pointer from the value container.
Returns
booleantrue if the scriptclass instance has been added successfully, false otherwise.
Description

The array will be resized if necessary.
See also:  


 
 top of page
Method alloc
Allocate the given number of array elements.
Signature
alloc(intmax)
 :boolean
Arguments
intmaxTotal number of elements.
Returns
booleantrue if the allocation succeeded, false otherwise.
Description

The number of used element, numElements, will be reset to 0.
See also:  


 
 top of page
Method contains
Check whether this array contains a scriptclass instance that equals the given object.
Signature
contains(Classc)
 :boolean
Arguments
ClasscScriptclass instance to compare to
Returns
booleantrue if the given scriptclass instance was found, false otherwise.

 
 top of page
Method containsObject
Check whether array contains an object that equals the given object.
Signature
containsObject(Objecto)
 :boolean
Arguments
ObjectoThe object to compare with. Object.yacEquals() is used for comparisons.
Returns
booleantrue 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(Objecto)
 :boolean
Arguments
ObjectoThe object (address) to compare with.
Returns
booleantrue if a matching object was found, false otherwise.
See also:  


 
 top of page
Method delete
Delete the given array element.
Signature
delete(intindex)
 :boolean
Arguments
intindexWhich element to delete
Returns
booleantrue if the given element has been deleted successfully, false otherwise.
See also:  


 
 top of page
Method empty
Reset number of used elements, numElements, to 0.
Signature
empty()
See also:  


 
 top of page
Method free
Free array elements.
Signature
free()
See also:  


 
 top of page
Method get
Return the given array element.
Signature
get(intindex)
 :Class
Arguments
intindexWhich element to return
Returns
ClassScriptclass instance
Description

Silently return null if "index" is out of bounds.
See also:  


 
 top of page
Method getDeref
Unlink and return the given (deletable) array element.
Signature
getDeref(intindex)
 :Class
Arguments
intindexWhich element to return
Returns
Class(deletable) Scriptclass instance
See also:  


 
 top of page
Method getMaxElements
Return total number of elements.
Signature
getMaxElements():int
Returns
intTotal number of elements.
See also:  


 
 top of page
Method getNextFree
Return next free element.
Signature
getNextFree():Class
Returns
Classnext free Class instance or null if the arraylist is full.
Description

Increase the number of used elements, numElements.
See also:  


 
 top of page
Method getNumElements
Return number of used elements.
Signature
getNumElements():int
Returns
intNumber of used elements
See also:  


 
 top of page
Method getTemplate
Return the template object that is currently being used to allocate new array elements.
Signature
getTemplate():Class
Returns
ClassScriptclass (instance)
See also:  


 
 top of page
Method indexOfObject
Return the index of the element that equals the given object.
Signature
indexOfObject(Objecto)
 :int
Arguments
ObjectoThe object to look for
Returns
intArray 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
indexOfPointer(Objecto)
 :int
Arguments
ObjectoThe object pointer to look for
Returns
intArray index or -1 if the object address was not found in this array
See also:  


 
 top of page
Method insert
Insert the given scriptclass instance into the array.
Signature
insert(intindex,
  Classc 
  )  
 :boolean
Arguments
intindexWhere to insert the scriptclass instance
ClasscScriptclass instance to insert. If c is a Value object, try to release the scriptclass instance pointer from the value container.
Returns
booleantrue if the scriptclassinstance has been inserted successfully, false otherwise.
See also:  


 
 top of page
Method realloc
Reallocate array elements.
Signature
realloc(intmax)
 :boolean
Arguments
intmaxTotal number of elements
Returns
booleantrue if the reallocation succeeded, false otherwise.
Description

Discard/add new elements as required.
See also:  


 
 top of page
Method remove
Delete the first element whose pointer equals the given scriptclass instance.
Signature
remove(Classc)
 :boolean
Arguments
ClasscScriptclass instance pointer to look for.
Returns
booleantrue if the given pointer was found and the corresponding array element has been removed, false otherwise.

 
 top of page
Method reverse
Reverse element order.
Signature
reverse()

 
 top of page
Method setNumElements
Set number of used elements.
Signature
setNumElements(intnum)
Arguments
intnumNew number of used elements.
See also:  


 
 top of page
Method setTemplate
Set the template object that shall be used to allocate new array elements.
Signature
setTemplate(Classsci)
Arguments
Classsci
See also:  


 
 top of page
Method swap
Swap two array elements.
Signature
swap(intindexA,
  intindexB 
  )  
 :boolean
Arguments
intindexAIndex of first array element
intindexBindex of second array element
Returns
booleantrue 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
useAll()

 
 top of page
 

Project Modules:core 
Project Classes:Boolean , Buffer , Byte , Class , ClassArray , Condition , Configuration , Double , DummyStream , 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 , mathClampi , mathDistancePointPlane2d , mathLerpf , mathMaxf , mathMaxi , mathMinf , mathMini , mathPowerf , mathPoweri , mathSmoothStepf , mathWrapf , mathWrapi , 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. Mon, 28/Dec/2015 13:15:54