|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.griphyn.vdl.router.BookKeeper
public class BookKeeper
This class stores state when constructing the DAG for output. It is expected that for each DAG generation, one instance of this class performs the state tracking. The class is tightly coupled to the class that performs the routing.
Route| Field Summary | |
|---|---|
private static String |
filenamechars
Where to draw filename characters from. |
private ADAG |
m_dax
The content of the abstract DAG for XML (DAX) is created after the alternatives are found. |
private SequenceMapping |
m_mapping
Unfortunately, for this release, we need to map the shortID of a derivation to some number that is acceptable to NMTOKEN, ID and IDREF. |
private HashMap |
m_parent
This map tracks the set of parents for each child derivation. |
private ListStack |
m_profileStack
The Profile elements in nested compound TR can
be equally nested. |
private Random |
m_rng
To create temporary filenames, we need an entropy source. |
private HashSet |
m_tempfiles
The temporary files must be unique on a per-workflow basis. |
private ArrayList |
m_transformations
The names of compound transformations that we got through. |
private HashMap |
m_visited
This contains the set of visited derivations. |
(package private) static String |
XXXXXX
String constant describing the six X. |
| Constructor Summary | |
|---|---|
BookKeeper()
Default ctor. |
|
| Method Summary | |
|---|---|
void |
addFilenames(Collection lfnset)
This method helps to track the input and output files. |
boolean |
addJob(Job job)
Accessor: Appends a job definition to the DAX structure. |
boolean |
addParent(HasPass current,
Set parents)
Adds a parent set for the given element to the state |
boolean |
addVisited(HasPass current,
Set real)
This method marks a derivation as visited in the set of visited nodes. |
private int |
adjustJobLevels(String startjob,
int distance)
Accessor: Recursively adjusts job level backwards. |
String |
createTempName(String hint,
String suffix)
Creates a unique temporary filename. |
List |
getAllProfiles()
Accessor: obtains all profiles on the profile stack. |
String |
getAllTransformations()
Accessor: obtains all transformations that were pushed as space separated string. |
HasPass |
getCurrent()
Obtains the current cursor position. |
ADAG |
getDAX(String name)
Accessor: Returns the constructed internal DAX keeper. |
private int |
getJobLevel(String jobid)
Accessor: Obtains the level of a given job from the DAX structure. |
Set |
getVisited(HasPass dv)
|
boolean |
isEmpty()
Detects valid results in the ADAG as opposed to an empty shell. |
String |
jobOf(String id)
Obtains an existing mapping of a DV indentification to a job id. |
String |
mapJob(String id)
Maps a DV identification to a name that can be put into the XML datatypes NMTOKEN, ID and IDREF. |
List |
popProfile()
Accessor: pop a vector of profiles from the profile stack. |
String |
popTransformation()
Accessor: pop an FQDI from the stack of transformations. |
void |
pushProfile(List profiles)
Accessor: push a vector of profiles down the profile stack. |
void |
pushTransformation(String fqdi)
Accessor: push the FQDI of a transformation onto a stack. |
void |
setCurrent(HasPass dv)
This method updates the "cursor" position with a new derivation. |
String |
toString()
dumps the state of this object into human readable format. |
void |
toString(Writer stream)
This method is a possibly more memory efficient version of constructing a DAG. |
String |
toXML(String indent,
String namespace)
Dumps the state of this object into machine readable XML. |
void |
toXML(Writer stream,
String indent)
This method is a possibly more memory efficient version of constructing a DAX. |
void |
toXML(Writer stream,
String indent,
String namespace)
This method is a possibly more memory efficient version of constructing a DAX. |
boolean |
wasVisited(HasPass dv)
Checks if a node was previously visited. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private HashMap m_visited
private HashMap m_parent
private ADAG m_dax
private SequenceMapping m_mapping
private ListStack m_profileStack
Profile elements in nested compound TR can
be equally nested.
private ArrayList m_transformations
private HashSet m_tempfiles
private Random m_rng
static final String XXXXXX
private static final String filenamechars
| Constructor Detail |
|---|
public BookKeeper()
| Method Detail |
|---|
public void pushProfile(List profiles)
profiles - is a list of profiles, may be empty.popProfile()public List popProfile()
pushProfile( java.util.List )public List getAllProfiles()
public void pushTransformation(String fqdi)
fqdi - is the fully-qualified definition identifier.popTransformation()public String popTransformation()
pushTransformation( String )public String getAllTransformations()
addJob( Job )public ADAG getDAX(String name)
public boolean addJob(Job job)
public void setCurrent(HasPass dv)
dv - is the new current derivation that the cursor will be set to.getCurrent()public HasPass getCurrent()
setCurrent( HasPass )public String mapJob(String id)
id - is the derivation identifier
public String jobOf(String id)
id - is the derivation identifier
private int getJobLevel(String jobid)
jobid - is the job identifier
private int adjustJobLevels(String startjob,
int distance)
ADAG.adjustLevels( String, int )
public boolean addParent(HasPass current,
Set parents)
current - is the current derivation to add parents forparents - are the parents, any number, to add for the given element
public boolean addVisited(HasPass current,
Set real)
current - is the caller to add to the visited node set.real - is the value to add for the given caller.
true, if the caller was previously unknown
to the visited set.public boolean wasVisited(HasPass dv)
dv - is the derivation to check, if it was visited before.
public Set getVisited(HasPass dv)
public void addFilenames(Collection lfnset)
lfnset - is a set of LFN instances, which encapsulate their
respective linkage.AbstractCollection.addAll( java.util.Collection )
public String createTempName(String hint,
String suffix)
hint - is a filename hint.suffix - is the suffix for the filename.
public boolean isEmpty()
public void toString(Writer stream)
throws IOException
stream - is a generic stream to put textual results onto.
IOExceptionpublic String toString()
toString in class Object
public void toXML(Writer stream,
String indent,
String namespace)
throws IOException
stream - is a generic stream to put XML results onto.indent - is the initial indentation level.namespace - is an optional XML namespace.
IOException
public void toXML(Writer stream,
String indent)
throws IOException
stream - is a generic stream to put XML results onto.indent - is the initial indentation level.
IOException
public String toXML(String indent,
String namespace)
indent - is the initial indentation level.namespace - is an optional XML namespace.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||