|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.isi.pegasus.planner.classes.Data
edu.isi.pegasus.planner.partitioner.Partition
public class Partition
This is an abstract container for a partition in the graph. This used for the generation of the partition element in the partition graph, and identifies the relations between the jobs in the partition if any.
| Field Summary | |
|---|---|
private String |
mID
The partition id of the partition. |
private int |
mIndex
The index associated with the partition. |
private GraphNode |
mLastAddedNode
A pointer to the last added node to the partition. |
private String |
mName
The name of the partition. |
private List |
mNodeList
The list of GraphNode |
private Set |
mNodeSet
The set of node id's in the partition. |
private Map |
mParentsMap
A map containing a node and it's parents ids in the partition. |
| Fields inherited from class edu.isi.pegasus.planner.classes.Data |
|---|
mLogger, mLogMsg |
| Constructor Summary | |
|---|---|
Partition()
The default constructor. |
|
Partition(List nodeList,
String id)
The overloaded constructor. |
|
| Method Summary | |
|---|---|
void |
addNode(GraphNode node)
Adds a node to the partition. |
void |
addParents(String node,
List parents)
Ends up assigning the parents to a particular node. |
Object |
clone()
Returns a copy of the object |
void |
constructPartition()
It while looking at the node list constructs the relations between the jobs in the partition, that can be gotten through getRelationsInPartition(). |
String |
getID()
It returns the unique id that is associated with the partition. |
int |
getIndex()
It returns the index to number of the partition. |
String |
getName()
It returns the name of the partition. |
Set |
getNodeIDs()
It returns the set of the job ids making up the partition. |
List |
getNodes()
Returns a list of nodes making up the partition. |
Map |
getRelations()
A function to return the child-parent relations for the jobs making up the partition. |
List |
getRootNodes()
Returns the root nodes in the partition. |
GraphNode |
lastAddedNode()
Returns the last added node to the partition. |
void |
setID(String id)
It sets the id of the partition. |
void |
setIndex(int index)
It sets the index associated with this partition to the value passed. |
void |
setName(String name)
It sets the partition name to the value passed. |
int |
size()
Returns the number of nodes in the partition. |
String |
toString()
Returns a String version of the object. |
String |
toXML()
Returns the xml description of the object. |
void |
toXML(Writer writer)
Returns the xml description of the object. |
private void |
writeAttribute(Writer writer,
String key,
String value)
Writes an attribute to the stream. |
| Methods inherited from class edu.isi.pegasus.planner.classes.Data |
|---|
setToString, vectorToString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private Set mNodeSet
private Map mParentsMap
private List mNodeList
GraphNode objects corresponding to the nodes
making the partiition.
private String mID
private int mIndex
private String mName
private GraphNode mLastAddedNode
| Constructor Detail |
|---|
public Partition()
public Partition(List nodeList,
String id)
nodeList - list of GraphNode objects.id - the partition id of the partition.| Method Detail |
|---|
public void addNode(GraphNode node)
node - the GraphNode object corresponding to the job
that is to be added.public GraphNode lastAddedNode()
public List getNodes()
GraphNode objects.public List getRootNodes()
GraphNode objects that are the root.public void constructPartition()
public void setName(String name)
name - the name to which the partition name needs to be set to.public String getName()
public void setIndex(int index)
index - the index value.public int getIndex()
public String getID()
public void setID(String id)
id - the id of the partition.public int size()
public String toString()
toString in class Data
public void toXML(Writer writer)
throws IOException
writer - is a Writer opened and ready for writing. This can also
be a StringWriter for efficient output.
IOException - if something fishy happens to the stream.
public String toXML()
throws IOException
IOException - if something fishy happens to the stream.
private void writeAttribute(Writer writer,
String key,
String value)
throws IOException
writer - key - value -
IOException - if something fishy happens to the stream.public Set getNodeIDs()
public void addParents(String node,
List parents)
node - the id of the node for which you want to add the parents.parents - list of id's of the parents of the nodes.public Map getRelations()
public Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||