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.


Constructor Index

 o NodeStd()

Method Index

 o getName()
Returns the part name.
 o getParentNode()
Returns the node's parent node or null if this is the root.
 o getPart()
Returns the node's part.
 o getProperty(String)
Returns the property with the name or null if not found.
 o getPropertyNames()
Returns an Enumeration of all the property names.
 o getRootNode()
Returns the root node, which has no parent node.
 o hasProperty(String)
Determines whether the node has the named property.
 o removeProperty(String)
Removes the property with the name.
 o setName(String)
Sets the node or part name.
 o setParentNode(Node)
Sets the node's parent node.
 o setPart(Object)
Sets the node's part, which may be any object whatsoever.
 o setProperty(String, Object)
Sets the property using the name and value.
 o toString()
Returns a String representation of the node.

Constructors

 o NodeStd
 public NodeStd()

Methods

 o 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".
 o getName
 public String getName()
Returns the part name.

Returns:
the name of the part.
 o 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.
 o getPart
 public Object getPart()
Returns the node's part.

Returns:
the node's part.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o getPropertyNames
 public Enumeration getPropertyNames()
Returns an Enumeration of all the property names.

Returns:
the Enumeration of all the property names.
 o getRootNode
 public Node getRootNode()
Returns the root node, which has no parent node.

Returns:
the root node.
 o 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