|
|||||||||
| 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.Leaf
public class Leaf
The leaf class of hmap trees. A leaf has a string name and a value of some type It has an extendable handle function for handling messages sent to the leaf through its hmap ancestors.
| Field Summary | |
|---|---|
static String |
CMD_SETVALUE
|
| Fields inherited from class ist.palcom.hmap.TreeNode |
|---|
CMD_SETNAME, CMD_SETPARENT, listeners, name, parent, path, TET_DIR, TET_LEAF, TET_UNKNOWN |
| Constructor Summary | |
|---|---|
Leaf(String name,
Object val)
|
|
| Method Summary | |
|---|---|
void |
computePath()
Computes the absolute path of the leaf (relative to the hmap root) |
Object |
getValue()
Gets the value of the leaf |
void |
handle(HmapEvent event)
|
void |
invokeHandler(HmapEvent event)
Invokes the handler function of the leaf |
void |
invokeHandler(String path,
HmapEvent event)
Invokes the handler function of the leaf |
boolean |
isAncestorOf(TreeNode node)
Returns true if this node is a direct ancestor of |
void |
resetPath()
Resets the path of the node. |
void |
setValue(Object val)
Sets the value of the leaf |
String |
toString()
|
String |
toString(int indent)
|
| 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_SETVALUE
| Constructor Detail |
|---|
public Leaf(String name,
Object val)
name - Name of the entryval - Value contained by this entry| Method Detail |
|---|
public void computePath()
computePath in class TreeNodepublic void handle(HmapEvent event)
public void setValue(Object val)
val - The new valuepublic Object getValue()
public String toString()
toString in class Objectpublic String toString(int indent)
toString in class TreeNodeindent - Start the returned string with a number of whitespaces
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 void resetPath()
TreeNode
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 | ||||||||