things.data.impl
Class NamedTreeNode

java.lang.Object
  extended by things.data.impl.NamedTreeNode

public class NamedTreeNode
extends java.lang.Object

Tree nodes.

Version:
1.0

Version History

EPG - Initial - 6 SEP 02
 
Author:
Erich P. Gatejen

Constructor Summary
NamedTreeNode()
          CONSTRUCTOR
 
Method Summary
 void clearValue()
          Remove any value to this node
 NamedTreeNode getOrCreateSubnode(java.lang.String name)
          Get the named node from the set.
 NamedTreeNode getSubnode(java.lang.String name)
          Get the named node from the set.
 java.util.Set<java.lang.String> getSubnodeNames()
          Get a set of subnodes.
 java.lang.Object getValue()
          Get the value.
 boolean hasValue()
          Does this node have a value?.
 void removeSubnode(java.lang.String name)
          Remove a named node from the set.
 void setValue(java.lang.Object value)
          Set the value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamedTreeNode

public NamedTreeNode()
CONSTRUCTOR

Method Detail

getValue

public java.lang.Object getValue()
Get the value. If it has no value, it will return null

Returns:
the terminal or null if this is a set

setValue

public void setValue(java.lang.Object value)
Set the value. A null will clear the value

Parameters:
value - set the value of this node

clearValue

public void clearValue()
Remove any value to this node


hasValue

public boolean hasValue()
Does this node have a value?.

Returns:
return true is this node has a value, otherwise false

getSubnode

public NamedTreeNode getSubnode(java.lang.String name)
Get the named node from the set. If it is a terminal or the node does not exist, it will return null;


removeSubnode

public void removeSubnode(java.lang.String name)
Remove a named node from the set. If it doesn't exist, don't worry about it!


getOrCreateSubnode

public NamedTreeNode getOrCreateSubnode(java.lang.String name)
Get the named node from the set. If it doesn't exist, create it!


getSubnodeNames

public java.util.Set<java.lang.String> getSubnodeNames()
Get a set of subnodes.

Returns:
a Set of Strings


Things.