com.ace.moab.api.jobs
Class JobAllocatedNodes

java.lang.Object
  extended by com.ace.moab.api.jobs.JobAllocatedNodes
All Implemented Interfaces:
java.lang.Iterable<JobAllocatedNode>

public class JobAllocatedNodes
extends java.lang.Object
implements java.lang.Iterable<JobAllocatedNode>


Constructor Summary
JobAllocatedNodes()
          Initializes an empty collection of jobs.
JobAllocatedNodes(java.util.Collection<JobAllocatedNode> allocatedNodes)
          Initialize the collection of jobs based on the collection of jobs given.
 
Method Summary
 void add(JobAllocatedNode node)
          Adds an allocated node to the collection.
 void clear()
          Clears the collection of all allocated nodes.
 int getAllocatedTasks(java.lang.String nodeID)
          Returns the number of tasks allocated for a particular node in question for the job.
 int getNodeCount()
          Returns the number of nodes allocated.
 java.util.Set<java.lang.String> getNodeIDs()
          Returns a list of node names.
 boolean isEmpty()
           
 java.util.Iterator<JobAllocatedNode> iterator()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JobAllocatedNodes

public JobAllocatedNodes()
Initializes an empty collection of jobs.


JobAllocatedNodes

public JobAllocatedNodes(java.util.Collection<JobAllocatedNode> allocatedNodes)
Initialize the collection of jobs based on the collection of jobs given. If the jobs passed in is null, an empty collection is initialized.

Parameters:
allocatedNodes - the jobs to store in the collection.
Method Detail

add

public void add(JobAllocatedNode node)
Adds an allocated node to the collection.

Parameters:
node - the allocated node to add to the collection.

clear

public void clear()
Clears the collection of all allocated nodes.


isEmpty

public boolean isEmpty()

getAllocatedTasks

public int getAllocatedTasks(java.lang.String nodeID)
Returns the number of tasks allocated for a particular node in question for the job.

Parameters:
nodeID - the node ID to search for in the job.
Returns:
the number of tasks allocated for the job on the node in question. If the node cannot be found or the node is null, 0 is returned.

getNodeCount

public int getNodeCount()
Returns the number of nodes allocated.

Returns:
the number of nodes allocated.

getNodeIDs

public java.util.Set<java.lang.String> getNodeIDs()
Returns a list of node names. If no nodes are allocated, an empty list is returned.

Returns:
a list of node names allocated to the job.

iterator

public java.util.Iterator<JobAllocatedNode> iterator()
Specified by:
iterator in interface java.lang.Iterable<JobAllocatedNode>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2001-2009 Cluster Resources, Inc. All Rights Reserved.