Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.SafeArray Class Reference

Re-entrant safe array. More...

Inheritance diagram for Dragengine.SafeArray:

Public Member Functions

Constructors
SafeArray new ()
 Create safe array.
Management
int getCount ()
 Nnumber of elements in the array.
bool has (Object element)
 Element is present.
int indexOf (Object element)
 Index of element or -1 if absent.
Object getAt (int index)
 Element at index.
void setAt (int index, Object element)
 Set element at index.
void add (Object element)
 Add element.
void addIfAbsent (Object element)
 Add element if absent.
void remove (Object element)
 Remove element.
void removeFrom (int index)
 Remove element from index.
void removeIfPresent (Object element)
 Remove element if present.
void removeAll ()
 Remove all elements.
void removeAll (Block ablock)
 Remove all elements applying a block to each element before removing.
void forEach (Block ablock)
 Visit elements in the array with a block.
Object find (Block ablock)
 Find element using a block.

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.

Referenced by remove().

◆ addIfAbsent()

void Dragengine.SafeArray.addIfAbsent ( Object element)

Add element if absent.

References setAt().

Referenced by remove().

◆ find()

Object Dragengine.SafeArray.find ( Block ablock)

Find element using a block.

Returns
Found element or null if no element matches,

References find(), forEach(), and removeAll().

Referenced by find().

◆ forEach()

void Dragengine.SafeArray.forEach ( Block ablock)

Visit elements in the array with a block.

References removeIfPresent().

Referenced by find().

◆ getAt()

Object Dragengine.SafeArray.getAt ( int index)

Element at index.

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

Referenced by setAt().

◆ getCount()

int Dragengine.SafeArray.getCount ( )

Nnumber of elements in the array.

References getCount().

Referenced by getCount().

◆ has()

bool Dragengine.SafeArray.has ( Object element)

Element is present.

Referenced by indexOf().

◆ indexOf()

int Dragengine.SafeArray.indexOf ( Object element)

Index of element or -1 if absent.

References has(), and indexOf().

Referenced by indexOf().

◆ new()

SafeArray Dragengine.SafeArray.new ( )

Create safe array.

References new().

Referenced by new().

◆ remove()

void Dragengine.SafeArray.remove ( Object element)

Remove element.

Exceptions
EInvalidParamelement is absent.

References add(), and addIfAbsent().

Referenced by removeAll().

◆ removeAll() [1/2]

void Dragengine.SafeArray.removeAll ( )

Remove all elements.

References remove().

Referenced by find().

◆ removeAll() [2/2]

void Dragengine.SafeArray.removeAll ( Block ablock)

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

References removeFrom().

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

Referenced by removeAll().

◆ removeIfPresent()

void Dragengine.SafeArray.removeIfPresent ( Object element)

Remove element if present.

Referenced by forEach().

◆ 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().

References getAt().

Referenced by addIfAbsent().


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