|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ace.moab.api.vm.VMCollection
public class VMCollection
This class represents a collection of VMs found in Moab. This groups multiple VMs into one object to allow group wide operations to be done on VMs such as adding and deleting and searching for VMs.
Constructor Summary | |
---|---|
VMCollection()
Initializes an empty collection of VMs. |
|
VMCollection(java.util.Collection<VM> vmCollection)
Initialize the collection of VMs based on the collection of VMs given. |
Method Summary | |
---|---|
void |
addVM(VM vm)
Adds a VM to the collection. |
VM |
findVM(java.lang.String vmID)
Attempts to find a VM with the respective VM ID. |
java.util.List<java.lang.String> |
getFilteredNodeNames()
Given the collection of VMs, this will returned the filtered node names. |
VM |
getIndex(int index)
Returns the VM at the associated node index. |
VM |
getProcIndex(int procIndex)
Gets the VM at the associated processor index. |
boolean |
isEmpty()
Returns true if no VMs are in the collection. |
java.util.Iterator<VM> |
iterator()
|
void |
removeVM(java.lang.String vmID)
Attempts to remove a VM from the collection. |
void |
removeVM(VM vm)
Attempts to remove a VM from the collection. |
int |
size()
Returns the number of VMs in the collection. |
java.util.List<VM> |
toList()
Converts the collection of VMs into a list of VM objects. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VMCollection()
public VMCollection(java.util.Collection<VM> vmCollection)
null
, an empty collection is
initialized.
vmCollection
- the VMs to store in the collection.Method Detail |
---|
public void addVM(VM vm)
vm
- the VM to be added.public VM findVM(java.lang.String vmID)
null
, null
is returned. Similarly, if the VM
cannot be found, null
is returned.
vmID
- the ID of the VM to search for.
public VM getIndex(int index)
Returns the VM at the associated node index. The node index starts at 1.
If no VM resides at the index, null
is returned.
index
- the node index of the VM to return.
public void removeVM(VM vm)
vm
- the VM to be removed.public void removeVM(java.lang.String vmID)
vmID
- the ID of the VM to be removed.public java.util.List<VM> toList()
public java.util.Iterator<VM> iterator()
iterator
in interface java.lang.Iterable<VM>
public boolean isEmpty()
public int size()
public java.util.List<java.lang.String> getFilteredNodeNames()
public VM getProcIndex(int procIndex)
The procIndex starts at 1.
For example, if this VM collection contains 3 VMs in this order:
procIndex
- The processor index
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |