Drag[en]gine Script Module DragonScript
1.23
|
Re-entrant safe array. More...
Public Member Functions | |
Constructors | |
SafeArray | new () |
Create safe array. More... | |
Management | |
int | getCount () |
Nnumber of elements in the array. More... | |
bool | has (Object element) |
Element is present. More... | |
int | indexOf (Object element) |
Index of element or -1 if absent. More... | |
Object | getAt (int index) |
Element at index. More... | |
void | setAt (int index, Object element) |
Set element at index. More... | |
void | add (Object element) |
Add element. More... | |
void | addIfAbsent (Object element) |
Add element if absent. More... | |
void | remove (Object element) |
Remove element. More... | |
void | removeFrom (int index) |
Remove element from index. More... | |
void | removeIfPresent (Object element) |
Remove element if present. More... | |
void | removeAll () |
Remove all elements. More... | |
void | removeAll (Block ablock) |
Remove all elements applying a block to each element before removing. More... | |
void | forEach (Block ablock) |
Visit elements in the array with a block. More... | |
Object | find (Block ablock) |
Find element using a block. More... | |
Re-entrant safe array.
Version of Array supporting modifying content while visited safely.
This is a native class.
void Dragengine.SafeArray.add | ( | Object | element | ) |
Add element.
EInvalidParam | element is present. |
void Dragengine.SafeArray.addIfAbsent | ( | Object | element | ) |
Add element if absent.
Object Dragengine.SafeArray.find | ( | Block | ablock | ) |
Find element using a block.
void Dragengine.SafeArray.forEach | ( | Block | ablock | ) |
Visit elements in the array with a block.
Object Dragengine.SafeArray.getAt | ( | int | index | ) |
Element at index.
EOutOfBoundary | index is less than 0 or larger than or equal to getCount(). |
int Dragengine.SafeArray.getCount | ( | ) |
Nnumber of elements in the array.
bool Dragengine.SafeArray.has | ( | Object | element | ) |
Element is present.
int Dragengine.SafeArray.indexOf | ( | Object | element | ) |
Index of element or -1 if absent.
SafeArray Dragengine.SafeArray.new | ( | ) |
Create safe array.
void Dragengine.SafeArray.remove | ( | Object | element | ) |
Remove element.
EInvalidParam | element is absent. |
void Dragengine.SafeArray.removeAll | ( | ) |
Remove all elements.
void Dragengine.SafeArray.removeAll | ( | Block | ablock | ) |
Remove all elements applying a block to each element before removing.
void Dragengine.SafeArray.removeFrom | ( | int | index | ) |
Remove element from index.
EInvalidParam | index is less than 0 or greater than or equal to getCount() - 1. |
void Dragengine.SafeArray.removeIfPresent | ( | Object | element | ) |
Remove element if present.
void Dragengine.SafeArray.setAt | ( | int | index, |
Object | element | ||
) |
Set element at index.
EOutOfBoundary | index is less than 0 or larger than or equal to getCount(). |