→ index of namespace default
 
→ index of project core
 
→ index of module core

Class core.PointerArray


Synopsis: An heterogenous array of objects.

  Base classes:
  Methods: Description:


A "deleteme" flag is stored with each element.
Object class types may be arbitrarily mixed.


See also:  


 
→ top of page

Method add
Add the given object to the arraylist.
Signature
add(Objecto)
 :boolean
Arguments
Objecto–The object to add to the arraylist. If o is a Value object, the contained (deletable) object will be released from the Value container.
Returns
boolean–true if the object has been added successfully, false otherwise.
Description

The array will be resized as required.

See also:  


 
→ top of page
Method alloc
Allocate the given number of array elements.
Signature
alloc(intmax)
 :boolean
Arguments
intmax–Total number of elements to allocate.
Returns
boolean–true if the allocation succeeded, false otherwise.
Description

The number of used elements, numElements, will be reset to 0.

See also:  


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

See also:  


 
→ top of page
Method delete
Delete the element at the given index.
Signature
delete(intindex)
Arguments
intindex–Which element to delete

See also:  


 
→ top of page
Method empty
Reset the number of used elements, numElements, to 0.
Signature
empty()
Description

This will reset the number of used elements, numElements, back to 0.

See also:  


 
→ top of page
Method free
Free array elements and reset array size (num/max).
Signature
free()

See also:  


 
→ top of page
Method get
Return a reference to the given array element.
Signature
get(intindex)
 :Object
Arguments
intindex–Which element to return
Returns
Object–Reference to array element.
Description

This will silently return null if "index" is out of bounds.

See also:  


 
→ top of page
Method getDeref
Return a (deletable) reference to the given array element.
Signature
getDeref(intindex)
 :Object
Arguments
intindex–Which element to return
Returns
Object–(deletable) reference to array element
Description

This will silently return null if "index" is out of bounds.

See also:  


 
→ top of page
Method getFirst
Return first array element.
Signature
getFirst():Object
Returns
Object–First array element or null if the array is empty. Objects are returned as non-deletable references.

 
→ top of page
Method getLast
Return last used array element.
Signature
getLast():Object
Returns
Object–Last used array element (numElements - 1) or null if the array is empty. Objects are returned as non-deletable references.

 
→ top of page
Method getMaxElements
Return the total number of elements.
Signature
getMaxElements():int
Returns
int–Total number of elements.

See also:  


 
→ top of page
Method getNextFree
Return a reference to the next free array element.
Signature
getNextFree():Object
Returns
Object–Reference to next free element.
Description

This will increase the number of used elements, numElements.

See also:  


 
→ top of page
Method getNumElements
Return the number of used elements.
Signature
getNumElements():int
Returns
int–Number of used elements

See also:  


 
→ top of page
Method getRev
Return element value at (numElements - 1 - index).
Signature
getRev(intindex)
 :Object
Arguments
intindex–Which element to return (starting from numElements-1)
Returns
Object–Element value
Description

Silently return null if resulting index is out of bounds.

 
→ top of page
Method getString
Return a string representation of this array.
Signature
getString():String
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
indexOfObject(Objecto)
 :int
Arguments
Objecto–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
indexOfPointer(Objecto)
 :int
Arguments
Objecto–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 insert
Insert the given object into the arraylist.
Signature
insert(intindex,
  Objecto 
  )  
 :boolean
Arguments
intindex–Where to insert the object
Objecto–The object to add. If "o" is a Value object, the contained (deletable) object will be released from the Value container.
Returns
boolean–true if the object has been inserted successfully, false otherwise.
Description

The array will be resized as required.

See also:  


 
→ top of page
Method isEmpty
Check if array is empty (numElements == 0).
Signature
isEmpty():boolean
Returns
boolean–

 
→ top of page
Method isFirst
Check if 'o' is the first element in this array.
Signature
isFirst(Objecto)
 :boolean
Arguments
Objecto–
Returns
boolean–

 
→ top of page
Method isLast
Check if 'o' is the last element in this array.
Signature
isLast(Objecto)
 :boolean
Arguments
Objecto–
Returns
boolean–

 
→ top of page
Method joinArrays
Join arrays 'a' and 'b'.
Signature
joinArrays(Objecta,
  Objectb,
  booleanbCopyA,
  booleanbCopyB,
  booleanbUnlinkA,
  booleanbUnlinkB 
  )  
 :boolean
Arguments
Objecta–Other array (or this, or null)
Objectb–Other array (or this, or null)
booleanbCopyA–If true, copy/duplicate array 'a' object values
booleanbCopyB–If true, copy/duplicate array 'b' object values
booleanbUnlinkA–If true, unlink object values from array 'a'. Takes precedence over bCopyA.
booleanbUnlinkB–If true, unlink object values from array 'b'. Takes precedence over bCopyA.
Returns
boolean–True if arrays were joined. False when new array elements could not be allocated.
Description

If none of the copy/unlink flags is set, object values will be copied by reference.
In case that 'a' or 'b' is 'this', object values will always be unlinked ("deref").
The joinCC(), joinCR(), joinCD(), joinRR(), joinRC(), joinRC(), joinRD(), joinDD(), joinDC(), joinDC() are providedfor reasons of convenience (permutations of the copyA/copyB/unlinkA/unlinkB arguments).
(C=copy, R=reference, D=deref (unlink))

 
→ top of page
Method joinCC
Join arrays a and b. Copy elements.
Signature
joinCC(Objecta,
  Objectb 
  )  
 :boolean
Arguments
Objecta–
Objectb–
Returns
boolean–

 
→ top of page
Method joinCD
Join arrays a and b. Copy 'A' elements, dereference 'B' elements.
Signature
joinCD(Objecta,
  Objectb 
  )  
 :boolean
Arguments
Objecta–
Objectb–
Returns
boolean–

 
→ top of page
Method joinCR
Join arrays a and b. Copy 'A' elements, reference 'B' elements.
Signature
joinCR(Objecta,
  Objectb 
  )  
 :boolean
Arguments
Objecta–
Objectb–
Returns
boolean–

 
→ top of page
Method joinDC
Join arrays a and b. Dereference 'A' elements, copy 'B' elements.
Signature
joinDC(Objecta,
  Objectb 
  )  
 :boolean
Arguments
Objecta–
Objectb–
Returns
boolean–

 
→ top of page
Method joinDD
Join arrays a and b. Dereference elements.
Signature
joinDD(Objecta,
  Objectb 
  )  
 :boolean
Arguments
Objecta–
Objectb–
Returns
boolean–

 
→ top of page
Method joinDR
Join arrays a and b. Dereference 'A' elements, reference 'B' elements.
Signature
joinDR(Objecta,
  Objectb 
  )  
 :boolean
Arguments
Objecta–
Objectb–
Returns
boolean–

 
→ top of page
Method joinRC
Join arrays a and b. Reference 'A' elements, copy 'B' elements.
Signature
joinRC(Objecta,
  Objectb 
  )  
 :boolean
Arguments
Objecta–
Objectb–
Returns
boolean–

 
→ top of page
Method joinRD
Join arrays a and b. Reference 'A' elements, dereference 'B' elements.
Signature
joinRD(Objecta,
  Objectb 
  )  
 :boolean
Arguments
Objecta–
Objectb–
Returns
boolean–

 
→ top of page
Method joinRR
Join arrays a and b. Reference elements.
Signature
joinRR(Objecta,
  Objectb 
  )  
 :boolean
Arguments
Objecta–
Objectb–
Returns
boolean–

 
→ top of page
Method realloc
Resize array.
Signature
realloc(intmax)
 :boolean
Arguments
intmax–New total number of elements.
Returns
boolean–true if the reallocation succeeded, false otherwise.
Description

Element will be discarded/added as required.

See also:  


 
→ top of page
Method rearrange
Reorder elements according to given element order.
Signature
rearrange(IntArrayorder)
 :boolean
Arguments
IntArrayorder–New element order
Returns
boolean–true if elements have been reordered successfully, false otherwise.

 
→ top of page
Method remove
Remove the given object from the arraylist.
Signature
remove(Objecto)
 :boolean
Arguments
Objecto–The object to remove.
Returns
boolean–true if the object has been removed successfully, false otherwise.
Description

The array will be searched for an entry matching the given object address.

See also:  


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

 
→ top of page
Method setNumElements
Set the number of used elements.
Signature
setNumElements(intnum)
Arguments
intnum–New number of used elements
Description

This will not reallocate the array.

See also:  


 
→ top of page
Method swap
Swap two array elements.
Signature
swap(intindexA,
  intindexB 
  )  
 :boolean
Arguments
intindexA–Index of first element
intindexB–Index of second element
Returns
boolean–true if the elements have been swapped successfully, false otherwise.

 
→ top of page
Method unlink
Return a deletable reference to array element at the given index and remove the element from this array.
Signature
unlink(Objecto)
 :Object
Arguments
Objecto–Object
Returns
Object–Deletable Object
Description
Return null if 'o' was not found in this array.

See also:  


 
→ top of page
Method unsetAll
Unset (free) all elements but keep array size (num/max).
Signature
unsetAll()

See also:  


 
→ 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 , LFSR , LFSR_NR , List , ListNode , Long , Mailbox , Mutex , Object , ObjectArray , PakFile , PointerArray , Pool , Process , 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 , mathCerpf , mathClampf , mathClampi , mathDistancePointPlane2d , mathFoldf , mathFoldi , mathGCD , mathLerpCyclicf , mathLerpf , mathMaxf , mathMaxi , mathMinf , mathMini , mathNextCyclicf , mathPowerf , mathPowerfC , mathPoweri , mathSerpf , mathSmoothStepf , mathSmoothStepNf , mathWrapf , mathWrapi , milliSeconds , milliSecondsDouble , psystem , putenv , srand , system , ucchar 
All Namespaces:default , graph , ui 
All Projects:core , eqxmms , ShaderVG , ShaderVG_Text , tkanalogrytm , tkchipmunk , tkclap , tkfileutils , tkfreeglut , tkfreetype2 , tkfreeverb , tkmath , tkmidi , tkmidipipe , tkminnie , tkoldmath , tkopengl , tkportaudio , tkradiastools , tksamplechain , tksampleedit , tksampler , tksdl , tksdl_net , tksidplay2 , tkspeexdsp , tksqlite , tktriangulate , tkui , tkvst2 , tkzip , ui , yingtest 


auto-generated by "DOG", the TkScript document generator. Tue, 3/Mar/2026 18:10:17