public class Array
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Array.ArrayType |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(double value)
Returns true if the array contains this real value.
|
boolean |
contains(float value)
Returns true if the array contains this real value.
|
boolean |
contains(int value)
Returns true if the array contains this integer value.
|
boolean |
contains(java.lang.String value)
Returns true if the array contains this string value.
|
static Array |
create(org.w3c.dom.Element arrayE)
Static factory method for creating non-sparse or sparse array types as
needed.
|
static Array |
create(java.util.List<java.lang.Object> values,
java.util.List<java.lang.Integer> indices) |
Array.ArrayType |
getType()
Get the type of this array.
|
int |
index(int position)
Returns the index of the value stored at the given position
|
static boolean |
isArray(org.w3c.dom.Element arrayE)
Utility method to check if an XML element is an array.
|
boolean |
isSparse()
Is this array a SparseArray?
|
int |
numValues()
Get the number of values in this array.
|
java.lang.String |
toString() |
java.lang.String |
value(int index)
Gets the value at index from the array.
|
double |
valueDouble(int index)
Gets the value at index from the array as a double.
|
float |
valueFloat(int index)
Gets the value at index from the array as a float.
|
int |
valueInt(int index)
Gets the value at index from the array as an int.
|
java.lang.String |
valueSparse(int indexOfIndex)
Gets the value at indexOfIndex from the array.
|
double |
valueSparseDouble(int indexOfIndex)
Gets the value at indexOfIndex from the array.
|
float |
valueSparseFloat(int indexOfIndex)
Gets the value at indexOfIndex from the array.
|
int |
valueSparseInt(int indexOfIndex)
Gets the value at indexOfIndex from the array.
|
java.lang.String |
valueSparseString(int indexOfIndex)
Gets the value at indexOfIndex from the array.
|
java.lang.String |
valueString(int index)
Gets the value at index from the array as a String.
|
public static boolean isArray(org.w3c.dom.Element arrayE)
arrayE
- the XML element to checkpublic static Array create(java.util.List<java.lang.Object> values, java.util.List<java.lang.Integer> indices) throws java.lang.Exception
java.lang.Exception
public static Array create(org.w3c.dom.Element arrayE) throws java.lang.Exception
arrayE
- the XML element encapsulating the arrayjava.lang.Exception
- if there is a problem when constructing the arraypublic Array.ArrayType getType()
public boolean isSparse()
public int numValues()
public boolean contains(java.lang.String value)
value
- the value to check for.public boolean contains(int value)
value
- the value to check forpublic boolean contains(double value)
value
- the value to check forpublic boolean contains(float value)
value
- the value to check forpublic int index(int position)
position
- the positionpublic java.lang.String value(int index) throws java.lang.Exception
index
- the index of the value to get.java.lang.Exception
- if index is out of bounds.public java.lang.String valueString(int index) throws java.lang.Exception
index
- the index of the value to get.java.lang.Exception
- if index is out of bounds.public double valueDouble(int index) throws java.lang.Exception
index
- the index of the value to get.java.lang.Exception
- if index is out of bounds.public float valueFloat(int index) throws java.lang.Exception
index
- the index of the value to get.java.lang.Exception
- if index is out of bounds.public int valueInt(int index) throws java.lang.Exception
index
- the index of the value to get.java.lang.Exception
- if index is out of bounds.public java.lang.String valueSparse(int indexOfIndex) throws java.lang.Exception
indexOfIndex
- the index of the index of the value to get.java.lang.Exception
- if indexOfIndex is out of bounds.public java.lang.String valueSparseString(int indexOfIndex) throws java.lang.Exception
indexOfIndex
- the index of the index of the value to get.java.lang.Exception
- if indexOfIndex is out of bounds.public double valueSparseDouble(int indexOfIndex) throws java.lang.Exception
indexOfIndex
- the index of the index of the value to get.java.lang.Exception
- if indexOfIndex is out of bounds.public float valueSparseFloat(int indexOfIndex) throws java.lang.Exception
indexOfIndex
- the index of the index of the value to get.java.lang.Exception
- if indexOfIndex is out of bounds.public int valueSparseInt(int indexOfIndex) throws java.lang.Exception
indexOfIndex
- the index of the index of the value to get.java.lang.Exception
- if indexOfIndex is out of bounds.public java.lang.String toString()
toString
in class java.lang.Object