EDU.auburn.VGJ.graph
Class GMLobject
java.lang.Object
|
+--EDU.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
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 |
GMLinteger
public static final int GMLinteger
GMLreal
public static final int GMLreal
GMLstring
public static final int GMLstring
GMLlist
public static final int GMLlist
GMLundefined
public static final int GMLundefined
GMLfile
public static final int GMLfile
key_
protected java.lang.String key_
value_
protected java.lang.Object value_
next_
protected GMLobject next_
type_
protected int type_
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.
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.