|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectist.palcom.hmap.TreeNode
ist.palcom.hmap.Dir
public class Dir
The dir class of hmap trees. A dir has a string name and a collection of children It has an extendable handle function for handling messages sent to the dir through its hmap ancestors and the outside.
| Field Summary | |
|---|---|
static String |
CMD_ADDENTRY
|
static String |
CMD_REMOVEENTRY
|
protected Collection |
entries
Collection of entries contained by this h-map dir. |
| Fields inherited from class ist.palcom.hmap.TreeNode |
|---|
CMD_SETNAME, CMD_SETPARENT, listeners, name, parent, path, TET_DIR, TET_LEAF, TET_UNKNOWN |
| Constructor Summary | |
|---|---|
Dir(String name)
|
|
| Method Summary | |
|---|---|
void |
addEntry(TreeNode node)
Adds a hmap node to this dir |
void |
computePath()
Computes the absolute path of the leaf (relative to the hmap root) |
void |
handle(HmapEvent event)
|
void |
invokeHandler(HmapEvent event)
Invokes the handler function of the dir |
void |
invokeHandler(String path,
HmapEvent event)
Invokes the handler function at a given path |
boolean |
isAncestorOf(TreeNode node)
Returns true if this node is a direct ancestor of |
Iterator |
iterator()
|
boolean |
remove(String path)
Removes the first found node at a given path |
void |
removeEntry(TreeNode node)
Removes a node from this dir |
boolean |
removeEntryByName(String name)
Removes the first found child node of this dir named |
void |
resetPath()
Resets the path recursively |
TreeNode |
resolve(String path)
|
Dir |
resolveDir(String path)
|
Leaf |
resolveLeaf(String path)
|
String |
toString()
|
String |
toString(int indent)
|
String |
toStringFlat()
|
| Methods inherited from class ist.palcom.hmap.TreeNode |
|---|
addListener, asDir, asLeaf, firstOfPath, getName, getParent, getPath, invokeListeners, isDir, isLeaf, printListeners, printListeners, removeListener, restOfPath, setName, setParent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, println |
| Field Detail |
|---|
public static final String CMD_ADDENTRY
public static final String CMD_REMOVEENTRY
protected Collection entries
| Constructor Detail |
|---|
public Dir(String name)
name - The name of the directory| Method Detail |
|---|
public void computePath()
computePath in class TreeNodepublic void handle(HmapEvent event)
public void invokeHandler(HmapEvent event)
invokeHandler in class TreeNodeevent - The payload to invoke the handler with
public void invokeHandler(String path,
HmapEvent event)
invokeHandler in class TreeNodeevent - The payload to invoke the handler withpath - The path on which to invoke the handlerpublic Dir resolveDir(String path)
path - the path to resolve
public Leaf resolveLeaf(String path)
path - the path to resolve
public TreeNode resolve(String path)
path - the path to resolve
public void addEntry(TreeNode node)
node - The entry to addpublic void removeEntry(TreeNode node)
node - The entry to removepublic boolean removeEntryByName(String name)
name - The name of the child node to remove
public boolean remove(String path)
path - The path of the node to be removed
public Iterator iterator()
public String toString()
toString in class Objectpublic String toStringFlat()
public String toString(int indent)
toString in class TreeNodeindent - Start the returned string with a number of whitespaces
public void resetPath()
resetPath in class TreeNodepublic boolean isAncestorOf(TreeNode node)
TreeNode
isAncestorOf in class TreeNodenode - The potential (grand)child node
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||