Drag[en]gine Script Module DragonScript  1.23
Dragengine.SafeArray Class Reference

Re-entrant safe array. More...

Inheritance diagram for Dragengine.SafeArray:

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...
 

Detailed Description

Re-entrant safe array.

Version of Array supporting modifying content while visited safely.

This is a native class.

Member Function Documentation

◆ add()

void Dragengine.SafeArray.add ( Object  element)

Add element.

Exceptions
EInvalidParamelement is present.

◆ addIfAbsent()

void Dragengine.SafeArray.addIfAbsent ( Object  element)

Add element if absent.

◆ find()

Object Dragengine.SafeArray.find ( Block  ablock)

Find element using a block.

Returns
Found element or null if no element matches,

◆ forEach()

void Dragengine.SafeArray.forEach ( Block  ablock)

Visit elements in the array with a block.

◆ getAt()

Object Dragengine.SafeArray.getAt ( int  index)

Element at index.

Exceptions
EOutOfBoundaryindex is less than 0 or larger than or equal to getCount().

◆ getCount()

int Dragengine.SafeArray.getCount ( )

Nnumber of elements in the array.

◆ has()

bool Dragengine.SafeArray.has ( Object  element)

Element is present.

◆ indexOf()

int Dragengine.SafeArray.indexOf ( Object  element)

Index of element or -1 if absent.

◆ new()

SafeArray Dragengine.SafeArray.new ( )

Create safe array.

◆ remove()

void Dragengine.SafeArray.remove ( Object  element)

Remove element.

Exceptions
EInvalidParamelement is absent.

◆ removeAll() [1/2]

void Dragengine.SafeArray.removeAll ( )

Remove all elements.

◆ removeAll() [2/2]

void Dragengine.SafeArray.removeAll ( Block  ablock)

Remove all elements applying a block to each element before removing.

◆ removeFrom()

void Dragengine.SafeArray.removeFrom ( int  index)

Remove element from index.

Exceptions
EInvalidParamindex is less than 0 or greater than or equal to getCount() - 1.

◆ removeIfPresent()

void Dragengine.SafeArray.removeIfPresent ( Object  element)

Remove element if present.

◆ setAt()

void Dragengine.SafeArray.setAt ( int  index,
Object  element 
)

Set element at index.

Exceptions
EOutOfBoundaryindex is less than 0 or larger than or equal to getCount().

The documentation for this class was generated from the following file: