acedb
Class Aceobj

java.lang.Object
  extended byacedb.Aceobj

public class Aceobj
extends java.lang.Object

The Aceobj objects are constructed by the Ace class. It is internally represented by a genreal tree suited for the Ace model. It does not have any database functions as defined in the AcePerl interface. For database functions use the Ace class.


Nested Class Summary
protected  class Aceobj.AceobjNode
           
protected  class Aceobj.DumpStore
          for storing the aceDump temperarily
 
Constructor Summary
Aceobj()
          Construct an empty object.
Aceobj(Aceobj.AceobjNode node)
          construct an object from a tree node.
Aceobj(java.lang.String objdump)
          Construct a full Aceobj from the acedump, should implement construction one line at time ON-DEMAND for efficiency.
 
Method Summary
 Aceobj at(java.lang.String tag_path)
          take a tag path separated by dot (.).
 Aceobj down()
          similar to right(), return a subtree of the parent
protected static Aceobj.AceobjNode find(Aceobj.AceobjNode n, java.lang.String tag)
          A search function, not to be used by the public.
 Aceobj get(java.lang.String tag)
          Search the object for the tag.
 java.lang.String getAceClass()
          return the Ace class type such as Sequence, Paper, int,.
 boolean isTag()
           
 void make(java.lang.String aceDump)
          make an object out of ace dump string.
 java.lang.String name()
          return the value of the class, such as Sequence, Paper, etc
 void print()
          print the object tree, row first.
protected static void print(Aceobj.AceobjNode o)
          dump out the node type:value, same format as ACE model.
 Aceobj right()
          low level tree traversal, will not follow into the database.
protected  Aceobj.AceobjNode searchDown(Aceobj.AceobjNode subtree, java.lang.String tag)
          search the immediate right tags downward.
 java.util.Vector tags()
          return the top level tags as a vector.
 java.lang.String toString()
          return the root's value as string
 java.lang.String type()
          return the ace class type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Aceobj

public Aceobj()
Construct an empty object.


Aceobj

public Aceobj(java.lang.String objdump)
Construct a full Aceobj from the acedump, should implement construction one line at time ON-DEMAND for efficiency. Most object operations don't need the whole object and the object construction is very expensive!


Aceobj

public Aceobj(Aceobj.AceobjNode node)
construct an object from a tree node.

Method Detail

make

public void make(java.lang.String aceDump)
make an object out of ace dump string.

Parameters:
aceDump - is the dump from one object dump only

print

protected static void print(Aceobj.AceobjNode o)
dump out the node type:value, same format as ACE model. This is not working right yet.


print

public void print()
print the object tree, row first.


find

protected static Aceobj.AceobjNode find(Aceobj.AceobjNode n,
                                        java.lang.String tag)
A search function, not to be used by the public. Only search the tags.


getAceClass

public java.lang.String getAceClass()
return the Ace class type such as Sequence, Paper, int,.

Returns:
String reprenting the calss type

type

public java.lang.String type()
return the ace class type


name

public java.lang.String name()
return the value of the class, such as Sequence, Paper, etc


toString

public java.lang.String toString()
return the root's value as string


isTag

public boolean isTag()

tags

public java.util.Vector tags()
return the top level tags as a vector.

Returns:
Vector of String type as tags names

right

public Aceobj right()
low level tree traversal, will not follow into the database.

Returns:
a new Aceobj as a subtree of the parent object, or null if nothing follows

down

public Aceobj down()
similar to right(), return a subtree of the parent


at

public Aceobj at(java.lang.String tag_path)
          throws AceException
take a tag path separated by dot (.). Such as Origin.from_species. To get the value of the tag you need to use the right function

Returns:
the object starting at tag, null if tag not found.
Throws:
AceException

get

public Aceobj get(java.lang.String tag)
Search the object for the tag.

Returns:
the node as an Aceobj or null

searchDown

protected Aceobj.AceobjNode searchDown(Aceobj.AceobjNode subtree,
                                       java.lang.String tag)
                                throws AceException
search the immediate right tags downward.

Returns:
returns null if not found
Throws:
AceException