|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.griphyn.vdl.Chimera
org.griphyn.vdl.dax.DAX
org.griphyn.vdl.dax.Child
public class Child
This class captures the parent-child relationship between any two nodes in a directed acyclic graph. For ease of external transportation, the graph is flattened into this two-level form. Please note that this presentation is slightly less powerful than the true DAGMan form, because for each child, there can be multiple parents, but multiple children cannot be grouped.
| Field Summary | |
|---|---|
private HashSet |
m_parentSet
Captures the list of parent nodes for this child node. |
private String |
m_thisChild
Captures the element for which we are constructing dependencies. |
| Constructor Summary | |
|---|---|
Child()
Default ctor: Constructs a child node w/o any parents |
|
Child(Job child)
Ctor: Constructs a child node. |
|
Child(Job child,
Job parent)
Convenience ctor: Constructs a child node with one parent. |
|
Child(String child)
Ctor: Constructs a child node. |
|
Child(String child,
String parent)
Convenience ctor: Constructs a child node with one parent. |
|
| Method Summary | |
|---|---|
void |
addParent(Job parent)
Accessor: Adds a parent job id as dependency to the list of parents. |
void |
addParent(String parent)
Accessor: Adds a parent job id as dependency to the list of parents. |
Object |
clone()
Creates and returns a copy of this object. |
String |
getChild()
Accessor: Obtains the child identifier. |
boolean |
getParent(String name)
Accessor: Obtains a parent, iff it is in the bag. |
int |
getParentCount()
Accessor: Obtains the count of parental dependencies. |
Iterator |
iterateParent()
Accessor: Provides an iterator for the parent list. |
void |
removeAllParent()
Accessor: Removes all parental dependencies. |
boolean |
removeParent(String name)
Accessor: Removes a parent name from the bag. |
void |
setChild(Job job)
Accessor: Sets the identifier for this dependency child. |
void |
setChild(String id)
Accessor: Sets the identifier for this dependency child. |
void |
toString(Writer stream)
Converts the active state into something meant for human consumption. |
void |
toXML(Writer stream,
String indent,
String namespace)
Dump the state of the current element as XML output. |
Child |
updateChild(Map mapping)
Updates the identifiers for child and parents from a mapping. |
| Methods inherited from class org.griphyn.vdl.Chimera |
|---|
escape, quote, toString, toXML, toXML, writeAttribute |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private HashSet m_parentSet
private String m_thisChild
| Constructor Detail |
|---|
public Child()
public Child(String child)
child - is the job ID of the child node.public Child(Job child)
child - is the job reference of the child node.
public Child(String child,
String parent)
public Child(Job child,
Job parent)
| Method Detail |
|---|
public Object clone()
clone in class Objectpublic void addParent(String parent)
parent - is the parent id to add, not the parent reference.Jobpublic void addParent(Job parent)
parent - is the parent reference to addJobpublic Iterator iterateParent()
Jobpublic String getChild()
null, if
the element is hollow.setChild( String )public boolean getParent(String name)
name - is the parent id to look up.
public int getParentCount()
Jobpublic void removeAllParent()
Jobpublic boolean removeParent(String name)
name - is the name of the parent ID to remove.
Job,
HashSet.remove(Object)public void setChild(String id)
id - is the job identifier.getChild()public void setChild(Job job)
job - is a job reference.getChild()public Child updateChild(Map mapping)
mapping - is the mapping between old and new identifier
clone().
public void toString(Writer stream)
throws IOException
toString in class Chimerastream - is a stream opened and ready for writing. This can also
be a string stream for efficient output.
IOException - if something fishy happens to the stream.
public void toXML(Writer stream,
String indent,
String namespace)
throws IOException
toXML in class Chimerastream - is a stream opened and ready for writing. This can also
be a string stream for efficient output.indent - is a String of spaces used for pretty
printing. The initial amount of spaces should be an empty string.
The parameter is used internally for the recursive traversal.namespace - is the XML schema namespace prefix. If neither
empty nor null, each element will be prefixed with this prefix,
and the root element will map the XML namespace.
IOException - if something fishy happens to the stream.BufferedWriter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||