|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ace.moab.api.node.Nodes
public class Nodes
This class represents a collection of Nodes found in Moab. This groups multiple nodes into one object to allow group wide operations to be done on Nodes such as adding and deleting and searching for nodes.
Constructor Summary | |
---|---|
Nodes()
Initializes an empty collection of nodes. |
|
Nodes(java.util.Collection<MoabNode> nodes)
Initialize the collection of nodes based on the collection of nodes given. |
Method Summary | |
---|---|
void |
addAll(java.util.Collection<? extends MoabNode> nodeCollection)
|
void |
addNode(MoabNode node)
Adds a node to the collection. |
MoabNode |
findNode(java.lang.String id)
Attempts to find a node with the respective node name. |
java.util.List<MoabNode> |
getComputeNodeList()
Returns only the compute nodes in the collection in sorted order. |
java.util.List<java.lang.String> |
getNodeNames()
Returns a list of all the node names in the collection in alphabetical order. |
boolean |
isEmpty()
Returns true if no nodes are in the collection. |
java.util.Iterator<MoabNode> |
iterator()
|
void |
removeNode(MoabNode node)
Attempts to remove a node from the collection. |
void |
removeNode(java.lang.String id)
Attempts to remove a node from the collection. |
int |
size()
Returns the number of nodes in the collection. |
java.util.List<MoabNode> |
toList()
Converts the collection of nodes into a list of node objects. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Nodes()
public Nodes(java.util.Collection<MoabNode> nodes)
null
, an empty collection is
initialized.
nodes
- the nodes to store in the collection.Method Detail |
---|
public void addNode(MoabNode node)
node
- the node to be added.public MoabNode findNode(java.lang.String id)
null
, null
is returned. Similarly, if the
node cannot be found, null
is returned.
id
- the name of the node to search for.
public java.util.List<MoabNode> getComputeNodeList()
public java.util.List<java.lang.String> getNodeNames()
public boolean isEmpty()
public java.util.Iterator<MoabNode> iterator()
iterator
in interface java.lang.Iterable<MoabNode>
public void removeNode(MoabNode node)
node
- the node to be removed.public void removeNode(java.lang.String id)
id
- the name of the node to be removed.public java.util.List<MoabNode> toList()
public int size()
public void addAll(java.util.Collection<? extends MoabNode> nodeCollection)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |