ist.palcom.hmap
Class HmapLeaf

java.lang.Object
  extended by ist.palcom.hmap.HmapNode
      extended by ist.palcom.hmap.HmapLeaf

public class HmapLeaf
extends HmapNode


Nested Class Summary
 class HmapLeaf.ValueHandler
           
 
Nested classes/interfaces inherited from class ist.palcom.hmap.HmapNode
HmapNode.NameHandler
 
Field Summary
static String HMAPLEAF_COMMAND_GETVALUE
           
static String HMAPLEAF_COMMAND_SETVALUE
           
 
Fields inherited from class ist.palcom.hmap.HmapNode
HET_DIR, HET_LEAF, HET_UNKNOWN, HMAPNODE_COMMAND_GETNAME, HMAPNODE_COMMAND_SETNAME, nameInvokator, nodeInvokator, parent, path, valueInvokator
 
Constructor Summary
HmapLeaf()
           
HmapLeaf(String name, Object val)
           
 
Method Summary
 Object getValue()
          Gets the value of the leaf
protected  void invokeHandlers(HmapEvent event)
          Resovles and invokes handlers specified in the event
protected  boolean isAncestorOf(HmapNode node)
          Returns true if this node is a direct ancestor of
protected  void recalculatePath(HmapPath parentPath)
          Recalculates the path on the basis of the path of ones ancestors
 HmapNode resolve(HmapPath path, int type)
          Resolves a node in the current h-map
 HmapNode resolveLocally(HmapKey key, int type)
          Resolves a child of the current node
 void setValue(HmapEvent event)
           
 void setValue(Object val)
          Sets the value of the leaf
 String toString()
           
 String toString(int indent)
           
 String toStringAll(int indent)
           
 
Methods inherited from class ist.palcom.hmap.HmapNode
addHandler, addInvokator, addListener, asDir, asLeaf, callback, getFullyQualifiedType, getHmapEntryType, getKey, getName, getParent, getPath, getType, getTypeVersion, handle, handlerIterator, hasHandlers, hasInvokators, hasListeners, hasName, hasType, invokation, invokatorIterator, invokeListeners, isDir, isLeaf, listenerIterator, printHandlers, printInvokators, printListeners, recalculatePath, removeHandler, removeInvocator, removeListener, resolve, resolve, resolveDir, resolveDir, resolveDirLocally, resolveDirLocally, resolveLeaf, resolveLeaf, resolveLeafLocally, resolveLeafLocally, resolveLocally, resolveLocally, setName, setName, setParent
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, println
 

Field Detail

HMAPLEAF_COMMAND_GETVALUE

public static final String HMAPLEAF_COMMAND_GETVALUE
See Also:
Constant Field Values

HMAPLEAF_COMMAND_SETVALUE

public static final String HMAPLEAF_COMMAND_SETVALUE
See Also:
Constant Field Values
Constructor Detail

HmapLeaf

public HmapLeaf()

HmapLeaf

public HmapLeaf(String name,
                Object val)
Parameters:
name - Name of the entry
val - Value contained by this entry
Method Detail

setValue

public void setValue(Object val)
Sets the value of the leaf

Parameters:
val - The new value

setValue

public void setValue(HmapEvent event)

getValue

public Object getValue()
Gets the value of the leaf

Returns:
The value

isAncestorOf

protected boolean isAncestorOf(HmapNode node)
Description copied from class: HmapNode
Returns true if this node is a direct ancestor of

Specified by:
isAncestorOf in class HmapNode
Parameters:
node - The potential (grand)child node

recalculatePath

protected void recalculatePath(HmapPath parentPath)
Description copied from class: HmapNode
Recalculates the path on the basis of the path of ones ancestors

Specified by:
recalculatePath in class HmapNode
Parameters:
parentPath - The path of ones parent

resolve

public HmapNode resolve(HmapPath path,
                        int type)
Description copied from class: HmapNode
Resolves a node in the current h-map

Specified by:
resolve in class HmapNode
Parameters:
path - the path of the node to resolve
type - the type of the given node. Can be leaf, dir and unknown
Returns:
The resolved node; null if none was resolved

resolveLocally

public HmapNode resolveLocally(HmapKey key,
                               int type)
Description copied from class: HmapNode
Resolves a child of the current node

Specified by:
resolveLocally in class HmapNode
Parameters:
key - The key of the child
type - The type of the given node. Can be leaf, dir and unknown
Returns:
The resolved node; null if none was resolved

invokeHandlers

protected void invokeHandlers(HmapEvent event)
Description copied from class: HmapNode
Resovles and invokes handlers specified in the event

Specified by:
invokeHandlers in class HmapNode
Parameters:
event - The event to invoke handlers with

toString

public String toString()
Overrides:
toString in class Object
Returns:
A stringified version of the leaf

toString

public String toString(int indent)
Specified by:
toString in class HmapNode
Parameters:
indent - Start the returned string with a number of whitespaces
Returns:
A stringified version of the leaf

toStringAll

public String toStringAll(int indent)
Specified by:
toStringAll in class HmapNode
Parameters:
indent - prepend a number of whitespaces to the retured string
Returns:
a stringified version of this node with all handlers, invokators and listernes also