|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.sourcejammer.project.NodeList
A linked and indexed colletion of Nodes. Each node within a NodeList must have a unique name.
| Field Summary | |
private java.util.Hashtable |
mhshIndex
|
private java.util.Hashtable |
mhshNames
|
private java.util.Vector |
mvecNodes
|
| Constructor Summary | |
NodeList()
|
|
| Method Summary | |
void |
addNode(Node node)
Adds a node to the list. |
Node[] |
getContentsAsArray()
Provided to dump contents of NodeList to an array of Nodes. |
NodeIterator |
getIterator()
Returns a NodeIterator for iterating through the contents of this NodeList. |
java.lang.String[] |
getListNames()
Returns the names of nodes in the list. |
Node |
getNode(int index)
Returns a Node based on it's index value. |
Node |
getNode(java.lang.String nodeName)
Returns a Node based on it's unique name. |
private void |
reindex()
|
Node |
removeNode(int index)
Removes a Node from the NodeList based on it's index value. |
Node |
removeNode(java.lang.String nodeName)
Removes a Node from the NodeList based on it's unique name. |
void |
setContentsFromArray(Node[] nodes)
Provided to set this NodeList using an array of Nodes. |
int |
size()
Returns the number of nodes in the ilst. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private java.util.Vector mvecNodes
private java.util.Hashtable mhshIndex
private java.util.Hashtable mhshNames
| Constructor Detail |
public NodeList()
| Method Detail |
public Node[] getContentsAsArray()
public void setContentsFromArray(Node[] nodes)
throws NodeExistsException
NodeExistsException - if the array contains more than one node with
the same nodename.
public void addNode(Node node)
throws NodeExistsException
node - -- the Node to be added.
NodeExistsException - if a Node with the same name
is already in the NodeList.
public Node getNode(int index)
throws NodeDoesNotExistException
NodeDoesNotExistException
public Node getNode(java.lang.String nodeName)
throws NodeDoesNotExistException
NodeDoesNotExistException
public Node removeNode(int index)
throws NodeDoesNotExistException
index - -- index of the Node to be removed.
NodeDoesNotExistException - -- if there is no node
at the specified index.
public Node removeNode(java.lang.String nodeName)
throws NodeDoesNotExistException
NodeDoesNotExistException - -- if there is no node
with the specified name.private void reindex()
public NodeIterator getIterator()
public int size()
public java.lang.String[] getListNames()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||