|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjasi.sim.user.tree.Tree<T>
T - The type.public abstract class Tree<T>
Create a node tree from a Lisp string.
| Field Summary | |
|---|---|
protected static int |
CHILD
Indicates a child node. |
protected static int |
ROOT
Indicates a root node. |
protected static int |
SIBLING
Indicates a sibling node. |
| Constructor Summary | |
|---|---|
Tree()
|
|
| Method Summary | ||
|---|---|---|
AbstractNode<T> |
current()
Get this tree's current node. |
|
static
|
get(java.util.Collection<AbstractNode<S>> nodeList,
S content)
Get all children of a given content for a list of nodes. |
|
protected void |
node(int type,
T content)
Create a node of a given type for the current node. |
|
static java.lang.String |
read(java.io.Reader reader)
Create a string for tree from a given reader. |
|
protected void |
reduceLevel()
Reduce the tree level. |
|
AbstractNode<T> |
root()
Get this tree's root node. |
|
java.lang.String |
toString()
Get string representation of this node. |
|
static
|
toString(java.util.Collection<AbstractNode<S>> nodeList)
Get string representation of a list of nodes. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final int ROOT
protected static final int CHILD
protected static final int SIBLING
| Constructor Detail |
|---|
public Tree()
| Method Detail |
|---|
public static java.lang.String read(java.io.Reader reader)
throws java.io.IOException
reader - The reader for the input.
java.io.IOException - If an I/O error occurs.
public static <S> java.util.Collection<AbstractNode<S>> get(java.util.Collection<AbstractNode<S>> nodeList,
S content)
S - The type of node content.nodeList - The list of nodes.content - The content of the children.
public static <S> java.lang.String toString(java.util.Collection<AbstractNode<S>> nodeList)
S - The content type of node.nodeList - The list of nodes.
protected final void reduceLevel()
protected final void node(int type,
T content)
throws TreeException
type - The node type.content - The node's content.
TreeException - Used invalid type.public final AbstractNode<T> root()
public final AbstractNode<T> current()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||