things.data
Interface ThingsPropertyTree

All Known Implementing Classes:
ThingsPropertyTreeBASIC, ThingsPropertyTreeRAM

public interface ThingsPropertyTree

Property tree interface. Property trees contained name attributes in a hierarchical scheme.
home:level1.level2.leveln.item

Version:
1.0

Version History

EPG - Initial - 24 JUL 04
 
Author:
Erich P. Gatejen

Method Summary
 void copyAndGraftBranch(java.lang.String sourceBranchPath, java.lang.String graftRoot)
          Copy a branch and graft it somewhere else.
 ThingsPropertyTree copyBranch(java.lang.String branchPath)
          Copy a branch of the tree as a new tree.
 ThingsPropertyView getBranch(java.lang.String path)
          Get a view of a branch on the tree.
 ThingsPropertyView getRoot()
          Get a view from the root.
 void infliltrate(ThingsPropertyTrunk tio)
          This is how you load and merge properties into an already populated tree.
 void init(ThingsPropertyTrunk tio)
          Tell the tree to init itself.
 void load()
          Tell the tree to load fresh.
 void save()
          Tell the tree to save itself.
 

Method Detail

getBranch

ThingsPropertyView getBranch(java.lang.String path)
                             throws ThingsException
Get a view of a branch on the tree. This view is on a shared tree, so any changes will be visible to every view. The branch will always be relative to the root.

Parameters:
path - path to the branch. Null we return the root.
Returns:
a view of the branch
Throws:
ThingsException

getRoot

ThingsPropertyView getRoot()
                           throws ThingsException
Get a view from the root. This view is on a shared tree, so any changes will be visible to every view

Returns:
a view
Throws:
ThingsException

copyBranch

ThingsPropertyTree copyBranch(java.lang.String branchPath)
                              throws ThingsException
Copy a branch of the tree as a new tree. The new tree will have no connection to the original.

Parameters:
branchPath - path to the branch from where to start the copy. An empty or null value will return the root.
Returns:
a new property tree starting from the branch
Throws:
ThingsException

copyAndGraftBranch

void copyAndGraftBranch(java.lang.String sourceBranchPath,
                        java.lang.String graftRoot)
                        throws ThingsException
Copy a branch and graft it somewhere else. The new nodes will have no connection to the other branch.

Parameters:
sourceBranchPath - path to the branch from where to copy. An empty or null value will return the root.
graftRoot - the path to where it should be grafted.
Throws:
ThingsException

load

void load()
          throws ThingsException
Tell the tree to load fresh. The actual action is up to the implementation.

Throws:
ThingsException

save

void save()
          throws ThingsException
Tell the tree to save itself. The actual action is up to the implementation.

Throws:
ThingsException

init

void init(ThingsPropertyTrunk tio)
          throws ThingsException
Tell the tree to init itself. It will dump any current properties. You'll need to load() new props. Typically, the ThingsPropertyTrunk needs to be primed with a ThingsPropertyTrunk.startRead() before the load() method is called. However this may be left up to the implementation.

Parameters:
tio - a trunk to load and save the properties
Throws:
ThingsException

infliltrate

void infliltrate(ThingsPropertyTrunk tio)
                 throws ThingsException
This is how you load and merge properties into an already populated tree. Typically, the ThingsPropertyTrunk needs to be primed with a ThingsPropertyTrunk.startRead() before the load() method is called. However this may be left up to the implementation.

Parameters:
tio - a trunk to load and save the properties
Throws:
ThingsException


Things.