Drag[en]gine Script Module DragonScript Script API  1.0
SafeArray Class Reference

Re-entrant safe array. More...

Inheritance diagram for 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 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.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Function Documentation

§ add()

void add ( Object  element)

Add element.

Exceptions
EInvalidParamelement is present.

§ addIfAbsent()

void addIfAbsent ( Object  element)

Add element if absent.

§ find()

Object find ( Block  ablock)

Find element using a block.

Returns
Found element or null if no element matches,

§ forEach()

void forEach ( Block  ablock)

Visit elements in the array with a block.

§ getAt()

Object getAt ( int  index)

Element at index.

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

§ getCount()

int getCount ( )

Nnumber of elements in the array.

§ has()

bool has ( Object  element)

Element is present.

§ indexOf()

int indexOf ( Object  element)

Index of element or -1 if absent.

§ new()

SafeArray new ( )

Create safe array.

§ remove()

void remove ( Object  element)

Remove element.

Exceptions
EInvalidParamelement is absent.

§ removeAll() [1/2]

void removeAll ( )

Remove all elements.

§ removeAll() [2/2]

void removeAll ( Block  ablock)

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

§ removeIfPresent()

void removeIfPresent ( Object  element)

Remove element if present.

§ setAt()

void 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: