org.opengts.util
Class JSON._Array

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector<JSON._Value>
              extended by org.opengts.util.JSON._Array
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<JSON._Value>, java.util.Collection<JSON._Value>, java.util.List<JSON._Value>, java.util.RandomAccess
Enclosing class:
JSON

public static class JSON._Array
extends java.util.Vector<JSON._Value>

JSON Array

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
JSON._Array()
          Constructor
JSON._Array(boolean... array)
          Constructor An Array of Booleans
JSON._Array(double... array)
          Constructor An Array of Doubles
JSON._Array(JSON._Array... array)
          Constructor An Array of other Arrays
JSON._Array(JSON._Object... array)
          Constructor An Array of Objects
JSON._Array(JSON._Value... array)
          Constructor An Array of other Values
JSON._Array(long... array)
          Constructor An Array of Longs
JSON._Array(java.lang.String... array)
          Constructor An Array of Strings
 
Method Summary
 boolean add(JSON._Value value)
          Add a JSON._Value to this JSON._Array
 boolean addValue(boolean value)
          Add a Boolean to this JSON._Array
 boolean addValue(double value)
          Add a Double to this JSON._Array
 boolean addValue(JSON._Array value)
          Add a JSON._Array to this JSON._Array
 boolean addValue(JSON._Object value)
          Add a JSON._Object to this JSON._Array
 boolean addValue(JSON._Value value)
          Add a JSON._Value to this JSON._Array
 boolean addValue(long value)
          Add a Long to this JSON._Array
 boolean addValue(java.lang.String value)
          Add a String to this JSON._Array
 JSON._Array getArrayValueAt(int ndx, JSON._Array dft)
          Returns the JSON._Array value at the specified index
 boolean getBooleanValueAt(int ndx, boolean dft)
          Returns the Boolean value at the specified index
 double[] getDoubleArray()
          Returns a double array of values contained in this JSON Array
 double getDoubleValueAt(int ndx, double dft)
          Returns the Double value at the specified index
 int[] getIntArray()
          Returns an int array of values contained in this JSON Array
 int getIntValueAt(int ndx, int dft)
          Returns the Integer value at the specified index
 long[] getLongArray()
          Returns a long array of values contained in this JSON Array
 long getLongValueAt(int ndx, long dft)
          Returns the Long value at the specified index
 JSON._Object getObjectValueAt(int ndx, JSON._Object dft)
          Returns the JSON._Object value at the specified index
 java.lang.String[] getStringArray()
          Returns a String array of values contained in this JSON Array
 java.lang.String getStringValueAt(int ndx, java.lang.String dft)
          Returns the String value at the specified index
 JSON._Value getValueAt(int ndx)
          Returns the JSON._Value at the specified index
 boolean isEmpty()
          Returns true if this array is empty
 JSON._Array setFormatIndent(boolean indent)
          Set format indent state
 int size()
          Gets the number of items in this array
 java.lang.String toString()
          Returns a String representation of this instance
 java.lang.StringBuffer toStringBuffer(int prefix, java.lang.StringBuffer sb)
          Write a String representation of this instance to the StringBuffer
 
Methods inherited from class java.util.Vector
add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, subList, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

JSON._Array

public JSON._Array()
Constructor


JSON._Array

public JSON._Array(JSON._Value... array)
Constructor An Array of other Values


JSON._Array

public JSON._Array(java.lang.String... array)
Constructor An Array of Strings


JSON._Array

public JSON._Array(long... array)
Constructor An Array of Longs


JSON._Array

public JSON._Array(double... array)
Constructor An Array of Doubles


JSON._Array

public JSON._Array(boolean... array)
Constructor An Array of Booleans


JSON._Array

public JSON._Array(JSON._Object... array)
Constructor An Array of Objects


JSON._Array

public JSON._Array(JSON._Array... array)
Constructor An Array of other Arrays

Method Detail

add

public boolean add(JSON._Value value)
Add a JSON._Value to this JSON._Array

Specified by:
add in interface java.util.Collection<JSON._Value>
Specified by:
add in interface java.util.List<JSON._Value>
Overrides:
add in class java.util.Vector<JSON._Value>

addValue

public boolean addValue(JSON._Value value)
Add a JSON._Value to this JSON._Array


addValue

public boolean addValue(java.lang.String value)
Add a String to this JSON._Array


addValue

public boolean addValue(long value)
Add a Long to this JSON._Array


addValue

public boolean addValue(double value)
Add a Double to this JSON._Array


addValue

public boolean addValue(boolean value)
Add a Boolean to this JSON._Array


addValue

public boolean addValue(JSON._Object value)
Add a JSON._Object to this JSON._Array


addValue

public boolean addValue(JSON._Array value)
Add a JSON._Array to this JSON._Array


getValueAt

public JSON._Value getValueAt(int ndx)
Returns the JSON._Value at the specified index


getObjectValueAt

public JSON._Object getObjectValueAt(int ndx,
                                     JSON._Object dft)
Returns the JSON._Object value at the specified index


getArrayValueAt

public JSON._Array getArrayValueAt(int ndx,
                                   JSON._Array dft)
Returns the JSON._Array value at the specified index


getStringValueAt

public java.lang.String getStringValueAt(int ndx,
                                         java.lang.String dft)
Returns the String value at the specified index


getIntValueAt

public int getIntValueAt(int ndx,
                         int dft)
Returns the Integer value at the specified index


getLongValueAt

public long getLongValueAt(int ndx,
                           long dft)
Returns the Long value at the specified index


getDoubleValueAt

public double getDoubleValueAt(int ndx,
                               double dft)
Returns the Double value at the specified index


getBooleanValueAt

public boolean getBooleanValueAt(int ndx,
                                 boolean dft)
Returns the Boolean value at the specified index


getStringArray

public java.lang.String[] getStringArray()
Returns a String array of values contained in this JSON Array


getIntArray

public int[] getIntArray()
Returns an int array of values contained in this JSON Array


getLongArray

public long[] getLongArray()
Returns a long array of values contained in this JSON Array


getDoubleArray

public double[] getDoubleArray()
Returns a double array of values contained in this JSON Array


size

public int size()
Gets the number of items in this array

Specified by:
size in interface java.util.Collection<JSON._Value>
Specified by:
size in interface java.util.List<JSON._Value>
Overrides:
size in class java.util.Vector<JSON._Value>
Returns:
The number of items in this array

isEmpty

public boolean isEmpty()
Returns true if this array is empty

Specified by:
isEmpty in interface java.util.Collection<JSON._Value>
Specified by:
isEmpty in interface java.util.List<JSON._Value>
Overrides:
isEmpty in class java.util.Vector<JSON._Value>
Returns:
True if this array is empty

setFormatIndent

public JSON._Array setFormatIndent(boolean indent)
Set format indent state


toStringBuffer

public java.lang.StringBuffer toStringBuffer(int prefix,
                                             java.lang.StringBuffer sb)
Write a String representation of this instance to the StringBuffer


toString

public java.lang.String toString()
Returns a String representation of this instance

Overrides:
toString in class java.util.Vector<JSON._Value>