public class SparseArray extends AssocArray implements java.io.Externalizable
| Modifier and Type | Class and Description |
|---|---|
class |
SparseArray.SAPairEnumeration |
AssocArray.Pair, AssocArray.PairEnumerationkeys, values| Constructor and Description |
|---|
SparseArray()
Constructs an instance of
SparseArray. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(FList newElement)
Adds a new element to the end of array.
|
void |
add(int index,
FList newElement)
Adds a new element to the array.
|
void |
dump()
Dumps the SparseArray.
|
FList |
elementAt(int index)
Returns the element, if any, associated with an index.
|
FList |
elementAt(java.lang.Integer index)
Returns the element, if any, associated with an index.
|
FList |
getAnyElement()
Returns an element (usually called when it is known that
there is only one).
|
java.util.Enumeration<java.lang.Integer> |
getKeyEnumerator()
Returns an enumeration of the index values in the array.
|
java.util.List<java.lang.Integer> |
getKeys()
Returns a read-only list of the index values in the sparsearray
|
AssocArray.PairEnumeration |
getPairs() |
int |
getSize()
Returns the number of element pairs in the array.
|
java.util.Enumeration<FList> |
getValueEnumerator()
Returns an enumeration of the values in the array.
|
java.util.List<FList> |
getValues()
Returns a read-only list of the values in the sparsearray
|
void |
readExternal(java.io.ObjectInput in) |
void |
remove(int index)
Remove an element from the array.
|
void |
writeExternal(java.io.ObjectOutput out) |
clear, containsKey, elements, get, isEmpty, keys, put, remove, sizepublic SparseArray()
SparseArray.
The array is initially empty.public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException,
java.io.InvalidClassException
readExternal in interface java.io.Externalizablejava.io.IOExceptionjava.lang.ClassNotFoundExceptionjava.io.InvalidClassExceptionpublic int getSize()
public FList elementAt(int index)
index - Where to find the element.Element.ELEMID_ANY,
Element.ELEMID_ASSIGN,
Element.ELEMID_MAXpublic FList elementAt(java.lang.Integer index)
index - Where to find the element.Element.ELEMID_ANY,
Element.ELEMID_ASSIGN,
Element.ELEMID_MAXpublic FList getAnyElement()
public void add(int index,
FList newElement)
index - Where to add the new element.newElement - The new element to add.Element.ELEMID_ANY,
Element.ELEMID_ASSIGN,
Element.ELEMID_MAXpublic void add(FList newElement)
newElement - The new element to add.Element.ELEMID_ANY,
Element.ELEMID_ASSIGN,
Element.ELEMID_MAXpublic void remove(int index)
index - Where to remove the element.public java.util.Enumeration<FList> getValueEnumerator()
public java.util.Enumeration<java.lang.Integer> getKeyEnumerator()
public java.util.List<FList> getValues()
public java.util.List<java.lang.Integer> getKeys()
public AssocArray.PairEnumeration getPairs()
getPairs in class AssocArraypublic void dump()