FOM Reference > Application > Arrays > fArray interface
  
fArray interface
Objects of this class represent collections of objects. Depending on the particular type of collection, there may be constraints on the objects contained in the collection, such as all being of a certain class.
Arrays and the objects they contain cannot be modified directly from outside. In some situations the object providing the array also offers methods that modify the contents of the array.
Generally, there are two different ways to access objects contained in an fArray: they may be accessed by index like in conventional arrays, or they can be accessed by name, similar to maps or hashes.
length attribute
Returns the number of elements in this array.
In modifiable arrays, decreasing the value of this property has the effect of truncating the array, deleting any elements stored beyond the new length.
It is usually not necessary to increase the length of an array before assigning to an out-of-range element: arrays automatically resize when an object is stored in a previously unused index position.
length
Access
read-write
Returns
unsigned int
item method
Return the item stored at the given index.
itemindex
Parameters
unsigned intindex
The index of the item to be returned.
Returns
Object. The item stored at the given index.
namedItem method
Return the item with the given name.
namedItemname
Parameters
Stringname
The name of the desired item.
Returns
Object. The item stored under the given name.
readResolve method
Return the object corresponding to the given serialized representation.
readResolveobj
Parameters
Objectobj
The serialized representation.
Returns
fArray. The object corresponding to the serialized representation.
setItem method
Sets the item stored at the given index.
setItemindexitem
Parameters
unsigned intindex
The index of the item to be set.
Objectitem
The item to be set.
Returns
void. None.
setNamedItem method
Store the given object under the specified name.
setNamedItemnameitem
Parameters
Stringname
The name of the item.
Objectitem
The Object to store under the given name.
Returns
void. This method does not return a value.