Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.huguesjohnson.tiamat
Class TreeNode

    java.lang.Object
      com.huguesjohnson.tiamat.TreeNode

All Implemented Interfaces:
  Storable

Direct Known Subclasses:
  NamedObjectTreeNode

public class TreeNode
extends java.lang.Object
implements Storable

TreeNode - stores object in a heirarchical (tree) structure

Author:
  Hugues Johnson

Field Summary
`static java.lang.String` | `DEFAULT_PATH_DELIMITER`

Constructor Summary
`TreeNode(java.lang.String name)`
`TreeNode(java.lang.String name, java.lang.Object object)`
`TreeNode(java.lang.String name, java.lang.Object object, TreeNode parent)`
`TreeNode(java.lang.String name, java.lang.String pathDelimiter)`
`TreeNode(java.lang.String name, java.lang.String pathDelimiter, java.lang.Object object)`
`TreeNode(java.lang.String name, java.lang.String pathDelimiter, java.lang.Object object, TreeNode parent)`

Method Summary
`protected void` | `addChild(TreeNode childNode)`
`TreeNode` | `getChild(int index)`
`int` | `getChildLeafCount(boolean recursive)`
`TreeNode[]` | `getChildLeaves(boolean recursive)`
`TreeNode` | `getChildNode(java.lang.String path, boolean recursive)`
`int` | `getChildNodeCount(boolean recursive)`
`TreeNode[]` | `getChildren()`
`java.lang.String` | `getName()`
`java.lang.Object` | `getObject()`
`TreeNode` | `getParent()`
`java.lang.String` | `getPath()`
`java.lang.String` | `getPathDelimiter()`
`void` | `insertChildNode(java.lang.String path, TreeNode node)` inserts a node at the specified path
`boolean` | `isLeaf()`
`boolean` | `isRoot()`
`void` | `onDeserialize(Formatter formatter, java.lang.String absoluteDir)` The onDeserialize event should be fired after an object is de-serialized.
`boolean` | `removeChildNode(java.lang.String path, boolean recursive)`
`void` | `setChild(int index, TreeNode child)`
`void` | `setChildren(TreeNode[] children)`
`void` | `setName(java.lang.String name)`
`void` | `setObject(java.lang.Object object)`
`void` | `setParent(TreeNode parent)`
`java.lang.String` | `toString()` returns a string representation of the object

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### DEFAULT_PATH_DELIMITER

    public static final java.lang.String DEFAULT_PATH_DELIMITER

See Also:
  Constant Field Values

Constructor Detail

### TreeNode

    public TreeNode(java.lang.String name)

### TreeNode

    public TreeNode(java.lang.String name,
                    java.lang.String pathDelimiter)

### TreeNode

    public TreeNode(java.lang.String name,
                    java.lang.Object object)

### TreeNode

    public TreeNode(java.lang.String name,
                    java.lang.String pathDelimiter,
                    java.lang.Object object)

### TreeNode

    public TreeNode(java.lang.String name,
                    java.lang.Object object,
                    TreeNode parent)

### TreeNode

    public TreeNode(java.lang.String name,
                    java.lang.String pathDelimiter,
                    java.lang.Object object,
                    TreeNode parent)

Method Detail

### getPathDelimiter

    public java.lang.String getPathDelimiter()

### getParent

    public TreeNode getParent()

### setParent

    public void setParent(TreeNode parent)

### setChildren

    public void setChildren(TreeNode[] children)

### getChildren

    public TreeNode[] getChildren()

### setChild

    public void setChild(int index,
                         TreeNode child)

### getChild

    public TreeNode getChild(int index)

### getObject

    public java.lang.Object getObject()

### setObject

    public void setObject(java.lang.Object object)

### getName

    public java.lang.String getName()

### setName

    public void setName(java.lang.String name)

### addChild

    protected void addChild(TreeNode childNode)

### getPath

    public java.lang.String getPath()

### isRoot

    public boolean isRoot()

### isLeaf

    public boolean isLeaf()

### removeChildNode

    public boolean removeChildNode(java.lang.String path,
                                   boolean recursive)

### getChildNode

    public TreeNode getChildNode(java.lang.String path,
                                 boolean recursive)

### getChildNodeCount

    public int getChildNodeCount(boolean recursive)

### getChildLeafCount

    public int getChildLeafCount(boolean recursive)

### getChildLeaves

    public TreeNode[] getChildLeaves(boolean recursive)

### insertChildNode

    public void insertChildNode(java.lang.String path,
                                TreeNode node)

  inserts a node at the specified path

### toString

    public java.lang.String toString()

  returns a string representation of the object

### onDeserialize

    public void onDeserialize(Formatter formatter,
                              java.lang.String absoluteDir)

  The onDeserialize event should be fired after an object is de-serialized. This allows objects to load transient members, set their working directory, and load Storable members if needed.

  Specified by:
    `onDeserialize` in interface `Storable`
  Parameters:
    `formatter` - the formatter to use to load any storable members
    `absoluteDir` - the working directory since all paths stored in the object should be relative

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD