back to index
StringArray
- can be used like an array list
- can be accessed in custom C++ extensions
- supports automatic resizing on-write (interpreted mode only)
- also see ValueArray, PointerArray, ObjectArray and Pool
Inheritance
Object -> StringArray
Properties
numElements - - number of used elements
maxElements - - number of available elements
nextFree - - return elements[num_elements++]
Methods
add (String _s)
addEmpty (int _num)
int alloc (int _num)
boolean contains (String _s) - return true if array contains a string which looks like _s (yacEquals())
int delete (int _idx)
empty () - reset numElements to 0
free () - delete all elements and reset numElements and maxElements to 0
String get (int _index) - safe-get reference to String at _index, silently return null if value was not found
String getCopy (int _index) - get copy of String at index, silently return null if value was not found
String getNextFree () - return elements[numElements] and increase numElements
int getNumElements ()
int getMaxElements ()
String getString () - convert array to string representation
int insert (int _idx, String _s)
int realloc (int _num)
int rearrange (IntArray _ia) - rearrange elements according to indices in _ia
reverse ()
setNumElements (int _num)
sortByLength (IntArray _ia) - sort array by length and write new index order to _ia. reallocates _ia.
sortByValue (IntArray _ia, int _casesensitive) - sort array by value and write new index order to _ia. reallocates _ia.
boolean swap (int _idxa, _idb) - swap elements
unset ()
Examples
back to index