|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectist.palcom.hmap.TreeNode
public abstract class TreeNode
| Field Summary | |
|---|---|
static String |
CMD_SETNAME
|
static String |
CMD_SETPARENT
|
protected ArrayList |
listeners
List of listeners of the node |
protected String |
name
hmap node name |
protected Dir |
parent
parent of the node |
protected String |
path
Path of the node. |
static int |
TET_DIR
|
static int |
TET_LEAF
|
static int |
TET_UNKNOWN
|
| Constructor Summary | |
|---|---|
protected |
TreeNode(int treeNodeType,
String name)
|
| Method Summary | |
|---|---|
void |
addListener(HmapListener listener)
|
Dir |
asDir()
|
Leaf |
asLeaf()
|
abstract void |
computePath()
computes the path of this node (relative to its hmap root) |
protected String |
firstOfPath(String path)
Return the first part of a path separated by "/". |
String |
getName()
|
Dir |
getParent()
|
String |
getPath()
|
abstract void |
invokeHandler(HmapEvent event)
Invokes this node's handler |
abstract void |
invokeHandler(String path,
HmapEvent event)
Invokes a handler at a given path with a given payload |
protected void |
invokeListeners(HmapEvent event)
Invokes this node's listeners with a given payload and this node's path |
abstract boolean |
isAncestorOf(TreeNode node)
Returns true if this node is a direct ancestor of |
boolean |
isDir()
|
boolean |
isLeaf()
|
protected String |
printListeners()
|
protected String |
printListeners(int indent)
|
void |
removeListener(HmapListener listener)
|
abstract void |
resetPath()
Resets the path of the node. |
protected String |
restOfPath(String path)
Returns the rest of a path separated by "/". |
void |
setName(String name)
Sets the name of the node |
void |
setParent(Dir parent)
Sets the parent of this node |
abstract String |
toString(int indent)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, println, toString |
| Methods inherited from interface ist.palcom.hmap.Handler |
|---|
handle |
| Field Detail |
|---|
public static final int TET_UNKNOWN
public static final int TET_DIR
public static final int TET_LEAF
public static final String CMD_SETNAME
public static final String CMD_SETPARENT
protected String name
protected String path
protected Dir parent
protected ArrayList listeners
| Constructor Detail |
|---|
protected TreeNode(int treeNodeType,
String name)
treeNodeType - the type of the treenodename - the name of the treenode| Method Detail |
|---|
public abstract void computePath()
public abstract void invokeHandler(String path,
HmapEvent event)
path - The path to invokeevent - The payload to invoke the handler withpublic abstract void invokeHandler(HmapEvent event)
event - The payload to invoke the handler withpublic abstract String toString(int indent)
indent - prepend a number of whitespaces to the retured string
public abstract void resetPath()
public abstract boolean isAncestorOf(TreeNode node)
node - The potential (grand)child nodepublic void addListener(HmapListener listener)
listener - The HmapListener to add to this node's listenerspublic void removeListener(HmapListener listener)
listener - The HmapListener to remove from this node's listenersprotected void invokeListeners(HmapEvent event)
payload - The payload the listeners gets invoked withpublic boolean isDir()
public boolean isLeaf()
public Dir asDir()
public Leaf asLeaf()
public void setParent(Dir parent)
parent - new parentpublic Dir getParent()
public String getPath()
public void setName(String name)
name - new namepublic String getName()
protected String firstOfPath(String path)
protected String restOfPath(String path)
protected String printListeners(int indent)
indent - start the returned string with a given number of whitespaces
protected String printListeners()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||