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

Class core.ValueArray


SynopsisAn array of dynamically typed script values.

  Base classes:
  Methods: See also:  


Method alloc
Allocate the given number of array elements.
Signature
alloc(intmax)
 :boolean
Arguments
intmaxTotal number of elements to allocate
Returns
booleantrue 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(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 empty
Reset number of elements.
Signature
empty()
See also:  


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


 
 top of page
Method get
Return the given array element.
Signature
get(intindex)
 :var
Arguments
intindexWhich array element to return
Returns
varelement 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
getDeref(intindex)
 :var
Arguments
intindexWhich array element to return
Returns
varelement 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
getFirst():var
Returns
varFirst 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
getLast():var
Returns
varLast 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
getMaxElements():int
Returns
intTotal number of elements
See also:  


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


 
 top of page
Method getString
Return a string representation of this array.
Signature
getString():String
Returns
Stringnew 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
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 joinArrays
Join arrays 'a' and 'b'.
Signature
joinArrays(Objecta,
  Objectb,
  booleanbCopyA,
  booleanbCopyB,
  booleanbUnlinkA,
  booleanbUnlinkB 
  )  
 :boolean
Arguments
ObjectaOther array (or this, or null)
ObjectbOther array (or this, or null)
booleanbCopyAIf true, copy/duplicate array 'a' object values
booleanbCopyBIf true, copy/duplicate array 'b' object values
booleanbUnlinkAIf true, unlink object values from array 'a'. Takes precedence over bCopyA.
booleanbUnlinkBIf true, unlink object values from array 'b'. Takes precedence over bCopyA.
Returns
booleanTrue 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 provided for 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
intmaxNew total number of elements
Returns
booleantrue 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
reverse()

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


 
 top of page
Method swap
Swap two array elements.
Signature
swap(intindexB)
 :boolean
Arguments
intindexBIndex of second 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