public class SparseArray extends Array implements java.io.Serializable
Array.ArrayType| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<java.lang.Integer> |
m_indices
The indices of the sparse array
|
protected int |
m_numNonZero
The number of non-zero elements
|
protected int |
m_numValues
The size of the array if known
|
| Modifier | Constructor and Description |
|---|---|
protected |
SparseArray(Array.ArrayType type,
java.util.List<java.lang.Object> values,
java.util.List<java.lang.Integer> indices)
Construct a sparse array from the given values and indices
|
protected |
SparseArray(org.w3c.dom.Element arrayE)
Construct a sparse array from an XML node
|
| Modifier and Type | Method and Description |
|---|---|
int |
index(int position)
Returns the index of the value stored at the given position
|
protected void |
initialize(org.w3c.dom.Element arrayE)
Initializes the array from the supplied XML element.
|
boolean |
isSparse()
Overrides isSparse() in Array and always returns true.
|
int |
locateIndex(int index)
Locates the greatest index that is not greater than the
given index.
|
int |
numNonZero()
Get the number of non-zero values in this sparse array
|
int |
numValues()
Get the number of values in this array.
|
java.lang.String |
toString() |
java.lang.String |
value(int arrIndex)
Gets the value at index from the array.
|
actualValue, contains, contains, contains, contains, create, create, getType, isArray, valueDouble, valueFloat, valueInt, valueSparse, valueSparseDouble, valueSparseFloat, valueSparseInt, valueSparseString, valueStringprotected int m_numValues
protected int m_numNonZero
protected java.util.List<java.lang.Integer> m_indices
protected SparseArray(org.w3c.dom.Element arrayE)
throws java.lang.Exception
arrayE - the Element containing the XMLjava.lang.Exception - if something goes wrongprotected SparseArray(Array.ArrayType type, java.util.List<java.lang.Object> values, java.util.List<java.lang.Integer> indices)
type - the type of the array elementsvalues - the values of the arrayindices - the indices of the arrayprotected void initialize(org.w3c.dom.Element arrayE)
throws java.lang.Exception
initialize in class ArrayarrayE - the XML containing the arrayjava.lang.Exception - if something goes wrongpublic boolean isSparse()
public int numValues()
public int numNonZero()
public int index(int position)
public int locateIndex(int index)
public java.lang.String value(int arrIndex)
throws java.lang.Exception