EDU.auburn.VGJ.graph
Class GMLobject

java.lang.Object
  extended byEDU.auburn.VGJ.graph.GMLobject

public class GMLobject
extends java.lang.Object

A GML object that does nothing but create itself and write itself.

Here is the source.

Author:
Larry Barowski

Field Summary
static int GMLfile
           
static int GMLinteger
           
static int GMLlist
           
static int GMLreal
           
static int GMLstring
           
static int GMLundefined
           
protected  java.lang.String key_
           
protected  GMLobject next_
           
protected  int type_
           
protected  java.lang.Object value_
           
 
Constructor Summary
GMLobject()
           
GMLobject(GMLlexer lexer, java.lang.String key)
          Create the object from a GMLlexer and key.
GMLobject(java.lang.String key, int type)
           
 
Method Summary
 void addObject(GMLobject object)
           
 void addObjectToEnd(GMLobject object)
           
 void deleteAll(java.lang.String key, int type)
           
 void deleteUnsafe()
           
 GMLobject getGMLSubObject(java.lang.String path, int type, boolean create)
          Get the first sub-object with path-key "path" and type "type", or null if no such object exists.
 GMLobject getNextGMLSubObject()
          Iterator initialized by getGMLSubObject().
 java.lang.Object getValue(java.lang.String path, int type)
          Get the value of the first sub object matching the path-key "path" and type "type", or null if there is no sub object.
 void prune()
          Remove all null GMLlists from the object tree.
 void setHashFromGML(java.lang.String path, int type, java.util.Hashtable hash)
          Insert the keys and values of the first sub-object with path-key "path" and type "type", into the hash table "hash".
 void setValue(java.lang.String path, int type, java.lang.Object value)
           
 java.lang.String toString(int numtabs)
          Print the text representation of the object tree, with "numtabs" leading tabs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GMLinteger

public static final int GMLinteger
See Also:
Constant Field Values

GMLreal

public static final int GMLreal
See Also:
Constant Field Values

GMLstring

public static final int GMLstring
See Also:
Constant Field Values

GMLlist

public static final int GMLlist
See Also:
Constant Field Values

GMLundefined

public static final int GMLundefined
See Also:
Constant Field Values

GMLfile

public static final int GMLfile
See Also:
Constant Field Values

key_

protected java.lang.String key_

value_

protected java.lang.Object value_

next_

protected GMLobject next_

type_

protected int type_
Constructor Detail

GMLobject

public GMLobject()

GMLobject

public GMLobject(java.lang.String key,
                 int type)

GMLobject

public GMLobject(GMLlexer lexer,
                 java.lang.String key)
          throws java.io.IOException,
                 ParseError
Create the object from a GMLlexer and key. A null key will cause a GMLfile object to be created.

Method Detail

toString

public java.lang.String toString(int numtabs)
Print the text representation of the object tree, with "numtabs" leading tabs.


getNextGMLSubObject

public GMLobject getNextGMLSubObject()
Iterator initialized by getGMLSubObject(). Returns the next sub-object matching the path-key and type specified in a previous call to getGMLSubObject(), or null if no such object exists.


getGMLSubObject

public GMLobject getGMLSubObject(java.lang.String path,
                                 int type,
                                 boolean create)
Get the first sub-object with path-key "path" and type "type", or null if no such object exists. If "create" is true, create the sub-object if it doesn't exist. If type is GMLreal and a matching GMLinteger is found, the integer object will be changed to a real. This function begins an iteration sequence that can continue with calls to getNextGMLSubObject().


setHashFromGML

public void setHashFromGML(java.lang.String path,
                           int type,
                           java.util.Hashtable hash)
Insert the keys and values of the first sub-object with path-key "path" and type "type", into the hash table "hash". If type is GMLreal and a matching GMLinteger is found, the integer object will be changed to a real.


getValue

public java.lang.Object getValue(java.lang.String path,
                                 int type)
Get the value of the first sub object matching the path-key "path" and type "type", or null if there is no sub object.


setValue

public void setValue(java.lang.String path,
                     int type,
                     java.lang.Object value)

addObject

public void addObject(GMLobject object)

addObjectToEnd

public void addObjectToEnd(GMLobject object)

deleteUnsafe

public void deleteUnsafe()

deleteAll

public void deleteAll(java.lang.String key,
                      int type)

prune

public void prune()
Remove all null GMLlists from the object tree.