org.opengts.util
Class JSON._Object

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

public static class JSON._Object
extends java.util.Vector<JSON._KeyValue>

JSON Object class

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._Object()
          Constructor
JSON._Object(JSON._KeyValue... kv)
          Constructor
JSON._Object(java.util.Vector<JSON._KeyValue> list)
          Constructor
 
Method Summary
 boolean add(JSON._KeyValue kv)
           
 boolean addKeyValue(JSON._KeyValue kv)
          Adds a key/value pair to this object
 boolean addKeyValue(java.lang.String key, boolean value)
          Adds a key/value pair to this object
 boolean addKeyValue(java.lang.String key, double value)
          Adds a key/value pair to this object
 boolean addKeyValue(java.lang.String key, int value)
          Adds a key/value pair to this object
 boolean addKeyValue(java.lang.String key, JSON._Array value)
          Adds a key/value pair to this object
 boolean addKeyValue(java.lang.String key, JSON._Object value)
          Adds a key/value pair to this object
 boolean addKeyValue(java.lang.String key, JSON._Value value)
          Adds a key/value pair to this object
 boolean addKeyValue(java.lang.String key, long value)
          Adds a key/value pair to this object
 boolean addKeyValue(java.lang.String key, java.lang.String value)
          Adds a key/value pair to this object
 void debugDisplayObject(int level)
          Print object contents (for debug purposes only)
 JSON._Array getArrayForName(java.lang.String[] name, JSON._Array dft)
          Gets the JSON._Array for the specified name
 JSON._Array getArrayForName(java.lang.String name, JSON._Array dft)
          Gets the JSON._Array for the specified name
 boolean getBooleanForName(java.lang.String[] name, boolean dft)
          Gets the String value for the specified name
 boolean getBooleanForName(java.lang.String name, boolean dft)
          Gets the String value for the specified name
 double getDoubleForName(java.lang.String[] name, double dft)
          Gets the Double value for the specified name
 double getDoubleForName(java.lang.String name, double dft)
          Gets the Double value for the specified name
 int getIntForName(java.lang.String[] name, int dft)
          Gets the Integer value for the specified name
 int getIntForName(java.lang.String name, int dft)
          Gets the Integer value for the specified name
 java.util.Collection<java.lang.String> getKeyNames()
          Gets a list of all key names in this object
 JSON._KeyValue getKeyValue(java.lang.String n)
          Gets the key/value pair for the specified name
 JSON._KeyValue getKeyValueAt(int ndx)
          Gets the key/value pair at the specified index
 int getKeyValueCount()
          Gets the number of key/value pairs in this object
 long getLongForName(java.lang.String[] name, long dft)
          Gets the Long value for the specified name
 long getLongForName(java.lang.String name, long dft)
          Gets the Long value for the specified name
 JSON._Object getObjectForName(java.lang.String[] name, JSON._Object dft)
          Gets the JSON._Object value for the specified name
 JSON._Object getObjectForName(java.lang.String name, JSON._Object dft)
          Gets the JSON._Object value for the specified name
 java.lang.String[] getStringArrayForName(java.lang.String[] name, java.lang.String[] dft)
          Gets the JSON._Array for the specified name
 java.lang.String[] getStringArrayForName(java.lang.String name, java.lang.String[] dft)
          Gets the JSON._Array for the specified name
 java.lang.String getStringForName(java.lang.String[] name, java.lang.String dft)
          Gets the String value for the specified name
 java.lang.String getStringForName(java.lang.String name, java.lang.String dft)
          Gets the String value for the specified name
 JSON._Value getValueForName(java.lang.String n)
          Gets the JSON._Value for the specified name
 JSON._Value getValueForName(java.lang.String[] name)
          Gets the JSON._Value for the specified name
 JSON._Object setFormatIndent(boolean indent)
          Set format indent state
 java.lang.String toString()
          Returns a String representation of this instance
 java.lang.String toString(boolean inclPrefix)
          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, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, 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._Object

public JSON._Object()
Constructor


JSON._Object

public JSON._Object(java.util.Vector<JSON._KeyValue> list)
Constructor


JSON._Object

public JSON._Object(JSON._KeyValue... kv)
Constructor

Method Detail

addKeyValue

public boolean addKeyValue(JSON._KeyValue kv)
Adds a key/value pair to this object


add

public boolean add(JSON._KeyValue kv)
Specified by:
add in interface java.util.Collection<JSON._KeyValue>
Specified by:
add in interface java.util.List<JSON._KeyValue>
Overrides:
add in class java.util.Vector<JSON._KeyValue>

addKeyValue

public boolean addKeyValue(java.lang.String key,
                           java.lang.String value)
Adds a key/value pair to this object


addKeyValue

public boolean addKeyValue(java.lang.String key,
                           int value)
Adds a key/value pair to this object


addKeyValue

public boolean addKeyValue(java.lang.String key,
                           long value)
Adds a key/value pair to this object


addKeyValue

public boolean addKeyValue(java.lang.String key,
                           double value)
Adds a key/value pair to this object


addKeyValue

public boolean addKeyValue(java.lang.String key,
                           boolean value)
Adds a key/value pair to this object


addKeyValue

public boolean addKeyValue(java.lang.String key,
                           JSON._Array value)
Adds a key/value pair to this object


addKeyValue

public boolean addKeyValue(java.lang.String key,
                           JSON._Object value)
Adds a key/value pair to this object


addKeyValue

public boolean addKeyValue(java.lang.String key,
                           JSON._Value value)
Adds a key/value pair to this object


getKeyValueCount

public int getKeyValueCount()
Gets the number of key/value pairs in this object


getKeyValueAt

public JSON._KeyValue getKeyValueAt(int ndx)
Gets the key/value pair at the specified index


getKeyValue

public JSON._KeyValue getKeyValue(java.lang.String n)
Gets the key/value pair for the specified name


getValueForName

public JSON._Value getValueForName(java.lang.String n)
Gets the JSON._Value for the specified name


getValueForName

public JSON._Value getValueForName(java.lang.String[] name)
Gets the JSON._Value for the specified name


getArrayForName

public JSON._Array getArrayForName(java.lang.String name,
                                   JSON._Array dft)
Gets the JSON._Array for the specified name


getArrayForName

public JSON._Array getArrayForName(java.lang.String[] name,
                                   JSON._Array dft)
Gets the JSON._Array for the specified name


getStringArrayForName

public java.lang.String[] getStringArrayForName(java.lang.String name,
                                                java.lang.String[] dft)
Gets the JSON._Array for the specified name


getStringArrayForName

public java.lang.String[] getStringArrayForName(java.lang.String[] name,
                                                java.lang.String[] dft)
Gets the JSON._Array for the specified name


getObjectForName

public JSON._Object getObjectForName(java.lang.String name,
                                     JSON._Object dft)
Gets the JSON._Object value for the specified name


getObjectForName

public JSON._Object getObjectForName(java.lang.String[] name,
                                     JSON._Object dft)
Gets the JSON._Object value for the specified name


getStringForName

public java.lang.String getStringForName(java.lang.String name,
                                         java.lang.String dft)
Gets the String value for the specified name


getStringForName

public java.lang.String getStringForName(java.lang.String[] name,
                                         java.lang.String dft)
Gets the String value for the specified name


getIntForName

public int getIntForName(java.lang.String name,
                         int dft)
Gets the Integer value for the specified name


getIntForName

public int getIntForName(java.lang.String[] name,
                         int dft)
Gets the Integer value for the specified name


getLongForName

public long getLongForName(java.lang.String name,
                           long dft)
Gets the Long value for the specified name


getLongForName

public long getLongForName(java.lang.String[] name,
                           long dft)
Gets the Long value for the specified name


getDoubleForName

public double getDoubleForName(java.lang.String name,
                               double dft)
Gets the Double value for the specified name


getDoubleForName

public double getDoubleForName(java.lang.String[] name,
                               double dft)
Gets the Double value for the specified name


getBooleanForName

public boolean getBooleanForName(java.lang.String name,
                                 boolean dft)
Gets the String value for the specified name


getBooleanForName

public boolean getBooleanForName(java.lang.String[] name,
                                 boolean dft)
Gets the String value for the specified name


getKeyNames

public java.util.Collection<java.lang.String> getKeyNames()
Gets a list of all key names in this object


debugDisplayObject

public void debugDisplayObject(int level)
Print object contents (for debug purposes only)


setFormatIndent

public JSON._Object 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._KeyValue>

toString

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