solar.service.directory
Class NameNode

java.lang.Object
  |
  +--solar.service.directory.NameNode

class NameNode
extends java.lang.Object

A node in the directory tree, either an internal node or a leaf node. A name node may have a set of children name nodes and a set of name records (such as network addresses).

Version:
$Id: NameNode.java,v 1.1 2003/08/01 20:06:23 glchen Exp $
Author:
Guanling Chen

Field Summary
protected  java.util.Set _children
           
protected  java.lang.String _label
           
protected  NameNode _parent
           
protected  java.util.Set _records
           
 
Constructor Summary
NameNode(java.lang.String label)
           
 
Method Summary
 void addChild(NameNode child)
          Add a child, either another name node or a name record.
 void addRecord(NameRecord rec)
          Add a name record to this name node.
 NameNode createChild(java.lang.String label)
          Create a new child with specified label.
 NameNode getChild(java.lang.String label)
          Return a child node with specified label.
 java.util.Set getChildren()
          Return the set of children of this name node.
 java.lang.String getLabel()
          Return the label of this name node.
 NameNode getParent()
          Return the parent node of this name node.
 java.util.Set getRecords()
          Return the set of name records for this name node.
 boolean isLeaf()
          Return whether this name node is a leaf of name tree.
 boolean isRoot()
          Return whether this name node is the root of name tree.
 void removeRecord(NameRecord rec)
          Remove a name record from this name node.
 void setParent(NameNode parent)
          Set the parent node of this name node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_label

protected java.lang.String _label

_children

protected java.util.Set _children

_records

protected java.util.Set _records

_parent

protected NameNode _parent
Constructor Detail

NameNode

public NameNode(java.lang.String label)
Method Detail

isLeaf

public boolean isLeaf()
Return whether this name node is a leaf of name tree.


isRoot

public boolean isRoot()
Return whether this name node is the root of name tree.


getLabel

public java.lang.String getLabel()
Return the label of this name node.


setParent

public void setParent(NameNode parent)
Set the parent node of this name node.


getParent

public NameNode getParent()
Return the parent node of this name node.


addChild

public void addChild(NameNode child)
Add a child, either another name node or a name record.


createChild

public NameNode createChild(java.lang.String label)
Create a new child with specified label.


getChild

public NameNode getChild(java.lang.String label)
Return a child node with specified label.


getChildren

public java.util.Set getChildren()
Return the set of children of this name node.


addRecord

public void addRecord(NameRecord rec)
Add a name record to this name node.


removeRecord

public void removeRecord(NameRecord rec)
Remove a name record from this name node.


getRecords

public java.util.Set getRecords()
Return the set of name records for this name node.