All Packages Class Hierarchy This Package Previous Next Index
Class uhr.core.structure.NodeStd
java.lang.Object
|
+----uhr.core.structure.NodeStd
- public class NodeStd
- extends Object
- implements Node
This class represents a single node in a hierarchical
System Tree.
The part name "MyCell" is not allowed. This is reserved for use
in Cell.findPart(String name).
See full documentation.
-
NodeStd()
-
-
getName()
- Returns the part name.
-
getParentNode()
- Returns the node's parent node or null if this is
the root.
-
getPart()
- Returns the node's part.
-
getProperty(String)
- Returns the property with the name or null if not found.
-
getPropertyNames()
- Returns an Enumeration of all the property names.
-
getRootNode()
- Returns the root node, which has no parent node.
-
hasProperty(String)
- Determines whether the node has the named property.
-
removeProperty(String)
- Removes the property with the name.
-
setName(String)
- Sets the node or part name.
-
setParentNode(Node)
- Sets the node's parent node.
-
setPart(Object)
- Sets the node's part, which may be any object whatsoever.
-
setProperty(String, Object)
- Sets the property using the name and value.
-
toString()
- Returns a String representation of the node.
NodeStd
public NodeStd()
setName
public void setName(String name)
- Sets the node or part name. This must be unique per container.
It must be alphanumeric, may contain periods, and must
not contain blanks or slashes. It cannot be null or a
zero length String. This is a required property.
Our convention is to capatalize the first letter of each
word making up the self-documenting part name. Examples
are "Root", "ControlRegistry" and "UserSecurity".
If part names are used for finding the part in other
containers, then to avoid name space conflicts the names
need careful design. This can achieve branch or system
uniqueness. This will happen if service parts are used
a lot. To support unique naming we allow periods in the
name, such as "org.jcon.security.UserAuthorization".
The part name "MyCell" is not allowed. This is reserved for use
in Cell.findPart(String name).
- Parameters:
- name - the name of the node.
- Throws: IllegalArgumentException
- if the name is "MyCell".
getName
public String getName()
- Returns the part name.
- Returns:
- the name of the part.
setPart
public void setPart(Object part)
- Sets the node's part, which may be any object whatsoever.
The object should be unique per container and probably
unique per System Tree. This is a required property.
If the part implements NodeUser then setNode(Node) will
be called, using "this" node.
- Parameters:
- part - the node's part.
getPart
public Object getPart()
- Returns the node's part.
- Returns:
- the node's part.
setParentNode
public void setParentNode(Node parentNode)
- Sets the node's parent node. This is required for
all nodes in a tree except the root, which is null.
- Parameters:
- parentNode - the parent of this node or null if
this is the root node.
getParentNode
public Node getParentNode()
- Returns the node's parent node or null if this is
the root.
- Returns:
- the parent of this node or null if this is the root node.
hasProperty
public boolean hasProperty(String name)
- Determines whether the node has the named property. Note that
often the property value is not needed, just whether the node
has it or not.
- Parameters:
- name - the property's name.
- Returns:
- true if the node has the property, false if not.
setProperty
public Object setProperty(String name,
Object value)
- Sets the property using the name and value.
- Parameters:
- name - the property name.
- value - the property value, which cannot be null.
- Returns:
- the previous value for the name or null if none.
removeProperty
public Object removeProperty(String name)
- Removes the property with the name.
- Parameters:
- name - the property name.
- Returns:
- the value removed or null if none.
getProperty
public Object getProperty(String name)
- Returns the property with the name or null if not found.
- Parameters:
- name - the property name of interest.
- Returns:
- the property with the name or null if not found.
getPropertyNames
public Enumeration getPropertyNames()
- Returns an Enumeration of all the property names.
- Returns:
- the Enumeration of all the property names.
getRootNode
public Node getRootNode()
- Returns the root node, which has no parent node.
- Returns:
- the root node.
toString
public String toString()
- Returns a String representation of the node. The standard
is the name of the node.
- Returns:
- a String representation of the node.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index