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

Class core.StringArray


SynopsisAn arraylist of Strings.

  Base classes:
  Methods: See also:  


Method add
Add a copy of the given string to this arraylist.
Signature
add(Strings)
 :boolean
Arguments
StringsThe string to append to this arraylist
Returns
booleantrue if the String has been added successfully, false otherwise
Description

The array will be resized as required.
See also:  


 
 top of page
Method addEmpty
Increase the number of used elements.
Signature
addEmpty(intnum)
 :int
Arguments
intnumNumber of elements to add
Returns
intNew number of used elements.
Description

This method will not reallocate the array.
See also:  


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

All previous elements will be discarded. The number of used elements, numElements, will be reset to 0.
See also:  


 
 top of page
Method containsObject
Check whether this array contains the given String. @yacEquals is used to compare to the given string.
Signature
containsObject(Strings)
 :boolean
Arguments
StringsString to look for
Returns
booleantrue if the String was found, false otherwise.
See also:  


 
 top of page
Method containsPointer
Check whether this array contains the given String address.
Signature
containsPointer(Strings)
 :boolean
Arguments
StringsString address to look for
Returns
booleantrue if the String address was found, false otherwise.

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


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


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


 
 top of page
Method get
Return a reference to an array element.
Signature
get(intindex)
 :String
Arguments
intindex
Returns
StringReference to String object
Description

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


 
 top of page
Method getCopy
Return a copy of an array element.
Signature
getCopy(intindex)
 :String
Arguments
intindexArray index
Returns
Stringnew String object holding a copy of the given array element.
See also:  


 
 top of page
Method getFirst
Return first array element.
Signature
getFirst():Object
Returns
ObjectFirst 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
ObjectLast 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
intTotal number of array elements
See also:  


 
 top of page
Method getNextFree
Return next free String.
Signature
getNextFree():String
Returns
StringReference to next String or null if array is full.
Description

Increase numElements.
See also:  


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


 
 top of page
Method getString
Return 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 insert
Insert a copy of the given String into this array.
Signature
insert(intindex,
  Strings 
  )  
 :boolean
Arguments
intindexWhere to insert the new element
StringsWhich string to insert
Returns
booleantrue if the String has been inserted successfully, false otherwise.
See also:  


 
 top of page
Method join
Join arrays 'a' and 'b'.
Signature
join(Objecta,
  Objectb 
  )  
Arguments
ObjectaOther array (or this, or null)
ObjectbOther array (or this, or null)

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

Discard/add elements as required.
See also:  


 
 top of page
Method rearrange
Rearrange array elements according to given order array.
Signature
rearrange(IntArrayorder)
 :boolean
Arguments
IntArrayorderHolds the new element order
Returns
booleantrue if the elements have been reordered successfully, false otherwise.
See also:  


 
 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 sortByLength
Sort strings by length and write new element order to "order".
Signature
sortByLength(IntArrayorder)
Arguments
IntArrayorderReceives the new element order
See also:  


 
 top of page
Method sortByValue
Sort strings by content and write new element order to "order".
Signature
sortByValue(IntArrayorder,
  booleanbCaseSensitive 
  )  
Arguments
IntArrayorderReceives the new element order
booleanbCaseSensitiveif true, sort case-sensitive, otherwise sort case-insensitive.
See also:  


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

 
 top of page
Method unset
Empty all Strings
Signature
unset()

 
 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