|
||||||||||
| 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.classes.VDL
org.griphyn.vdl.classes.Definition
org.griphyn.vdl.classes.Transformation
public class Transformation
Transformation is an implementation of an abstract VDL
Definition. A transformation describes the immutable
template of an input, processing, and output (IPO) application. The
environment is part of the capture. The template can be parametrized
using formal arguments, which are part of the transformation
definition. Think of a transformation as something similar to a C
function definition. Mutable parts are hidden in the arguments, and
instantiated in Derivation.
FIXME: The mixing of compounds with simple transformations within the same class instead of hierarchy needs some serious redesigning. Unfortunately, this entails a redesign of just about everything...
Definition,
Definitions,
Derivation,
Serialized Form| Field Summary | |
|---|---|
private ArrayList |
m_argumentList
The argument list describes the command line arguments as sum of substrings. |
private String |
m_argumentSeparator
All arguments are, for ease-of-use, separated by a single space. |
private ArrayList |
m_callList
Each entry in the call list describes an invocation of another transformation, complete with actual arguments etc. |
private TreeMap |
m_declareMap
Captures the argument name indexed map of formal arguments. |
private TreeMap |
m_localMap
Each compound transformation may declare local variables. |
private ArrayList |
m_profileList
The profile list encapsulates scheduler specific data in a generic structure. |
| Fields inherited from class org.griphyn.vdl.classes.Definition |
|---|
DERIVATION, TRANSFORMATION |
| Constructor Summary | |
|---|---|
Transformation()
Default ctor: This ctor will frequently be used by the SAX parser to create a hollow instance. |
|
Transformation(String name)
Minimum c'tor: Any transformation should be named. |
|
Transformation(String namespace,
String name,
String version)
Standard ctor: This will name a transformation with the complete tripel necessary to access it correctly (w/o guessing). |
|
| Method Summary | |
|---|---|
void |
addArgument(Argument vArgument)
Accessor: Adds an argument to the list of arguments |
void |
addArgument(int index,
Argument vArgument)
Accessor: Inserts an argument at an arbitrary place into the list. |
void |
addCall(Call vCall)
Accessor: Adds an invocation to the list of calls. |
void |
addCall(int index,
Call vCall)
Accessor: Inserts an invocation at an arbitrary place into the list. |
void |
addDeclare(Declare vDeclare)
Accessor: Adds a formal argument declaration to the map of declarations. |
void |
addLocal(Local vLocal)
Accessor: Adds a temporary variable declaration to the map of local variables. |
void |
addProfile(int index,
Profile vProfile)
Accessor: Inserts a profile definition at an arbitrary position into the list of profiles. |
void |
addProfile(Profile vProfile)
Accessor: Appends a profile definition to the list of profiles. |
Enumeration |
enumerateArgument()
Deprecated. Use the new Collection based interfaces |
Enumeration |
enumerateCall()
Deprecated. Use the new Collection based interfaces |
Enumeration |
enumerateDeclare()
Deprecated. Use the new Collection based interfaces |
Enumeration |
enumerateLocal()
Deprecated. Use the new Collection based interfaces |
Enumeration |
enumerateProfile()
Deprecated. Use the new Collection based interfaces |
Argument[] |
getArgument()
Deprecated. Use the new Collection based interfaces |
Argument |
getArgument(int index)
Accessor: Obtains an Argument at an arbitrary position. |
int |
getArgumentCount()
Accessor: Obtains the count of items in the argument list. |
List |
getArgumentList()
Accessor: Obtains the complete commandline arguments. |
String |
getArgumentSeparator()
Gets the separating string between multiple Argument
elements. |
Call[] |
getCall()
Deprecated. Use the new Collection based interfaces |
Call |
getCall(int index)
Accessor: Obtains an Call at an arbitrary position. |
int |
getCallCount()
Accessor: Obtains the count of items in the call list. |
List |
getCallList()
Accessor: Obtains the invocation list. |
Declare[] |
getDeclare()
Deprecated. Use the new Collection based interfaces |
Declare |
getDeclare(String name)
Accessor: Obtains the declaration of a formal argument as referenced by its variable name. |
int |
getDeclareCount()
Accessor: Counts the number of formal arguments known to this transformation. |
List |
getDeclareList()
Accessor: Obtain all known formal arguments. |
Map |
getDeclareMap()
Accessor: Obtains all known formal arguments. |
Local[] |
getLocal()
Deprecated. Use the new Collection based interfaces |
Local |
getLocal(String name)
Accessor: Obtains the declaration of a temporary variable as referenced by its name. |
int |
getLocalCount()
Accessor: Counts the number of temporary variables known to this transformation. |
List |
getLocalList()
Accessor: Obtains all known temporary variables. |
Map |
getLocalMap()
Accessor: Obtains all known temporary variables. |
Profile[] |
getProfile()
Deprecated. Use the new Collection based interfaces |
Profile |
getProfile(int index)
Accessor: Obtains an Profile at an arbitrary position. |
int |
getProfileCount()
Accessor: Counts the number of profile specifications known to this job. |
List |
getProfileList()
Accessor: Obtain a read-only copy of the list of all Profile specifications. |
int |
getType()
Type accessor for quick distinction between definitions. |
String |
identify()
Constructs dynamically a short descriptive, hopefully unique identifier for this transformation. |
boolean |
isSimple()
Predicate: Determines, if this is a simple TR (as opposed to compound). |
Iterator |
iterateArgument()
Accessor: Provides an iterator for the Argument list. |
Iterator |
iterateCall()
Accessor: Provides an iterator for the Call list. |
Iterator |
iterateDeclare()
Accessor: Provides an iterator for the Declare map. |
Iterator |
iterateLocal()
Accessor: Provides an iterator for local variables. |
Iterator |
iterateProfile()
Accessor: Provides an iterator for the Profile list. |
ListIterator |
listIterateArgument()
Accessor: Provides a list iterator for the Argument list. |
ListIterator |
listIterateArgument(int start)
Accessor: Provides a list iterator for the Argument list. |
ListIterator |
listIterateCall()
Accessor: Provides a list iterator for the Call list. |
ListIterator |
listIterateCall(int start)
Accessor: Provides a list iterator for the Call list. |
ListIterator |
listIterateProfile()
Accessor: Provides a list iterator for the Profile list. |
ListIterator |
listIterateProfile(int start)
Accessor: Provides a list iterator for the Profile list. |
void |
removeAllArgument()
Accessor: Removes all commandline arguments. |
void |
removeAllCall()
Accessor: Removes all calls. |
void |
removeAllDeclare()
Accessor: Removes all formal arguments. |
void |
removeAllLocal()
Accessor: Removes all temporary variables. |
void |
removeAllProfile()
Accessor: Removes all profile declarations. |
Argument |
removeArgument(int index)
Accessor: Removes a commandline argument fragment from the commandline. |
Call |
removeCall(int index)
Accessor: Removes a single call fragment from the list of calls. |
Declare |
removeDeclare(String name)
Accessor: Removes a formal argument. |
Local |
removeLocal(String name)
Accessor: Removes a temporary variable. |
Profile |
removeProfile(int index)
Accessor: Removes a profile. |
void |
setArgument(Argument[] argumentArray)
Deprecated. Use the new Collection based interfaces |
void |
setArgument(Collection arguments)
Accessor: Replace the commandline arguments with a new commandline argument. |
void |
setArgument(int index,
Argument vArgument)
Accessor: Overwrites an commandline argument fragment with a new one. |
void |
setArgumentSeparator(String separator)
Overwrites the internal separator string between neighbouring Argument elements with new content. |
void |
setCall(Call[] callArray)
Deprecated. Use the new Collection based interfaces |
void |
setCall(Collection calls)
Accessor: Replace the calls with a new call list. |
void |
setCall(int index,
Call vCall)
Accessor: Overwrites a call with a new one. |
void |
setDeclare(Collection declares)
Accessor: Replace all declarations by a new set of declarations. |
void |
setDeclare(Declare vDeclare)
Accessor: Insert or replace a declaration with a new version. |
void |
setDeclare(Declare[] declareArray)
Deprecated. Use the new Collection based interfaces |
void |
setDeclare(Map declares)
Accessor: Replace all declarations by a new set of declarations. |
void |
setLocal(Collection locals)
Accessor: Replaces all declarations by a new set of declarations. |
void |
setLocal(Local vLocal)
Accessor: Inserts or replaces a temporary variable with a new version. |
void |
setLocal(Local[] localArray)
Deprecated. Use the new Collection based interfaces |
void |
setLocal(Map locals)
Accessor: Replace all declarations by a new set of declarations. |
void |
setProfile(Collection profiles)
Accessor: Replace the internal profiles with a new list. |
void |
setProfile(int index,
Profile vProfile)
Accessor: Overwrites a profile with a new profile |
void |
setProfile(Profile[] profileArray)
Deprecated. Use the new Collection based interfaces |
void |
toString(Writer stream)
Dumps the content of the given element into a string. |
void |
toXML(Writer stream,
String indent,
String namespace)
Dump the state of the current element as XML output. |
| Methods inherited from class org.griphyn.vdl.classes.Definition |
|---|
compareTo, equals, getDescription, getKeyword, getName, getNamespace, getTitle, getUrl, getVersion, hashCode, match, setDescription, setKeyword, setName, setNamespace, setTitle, setUrl, setVersion, shortID, shortID, toXML, toXML |
| Methods inherited from class org.griphyn.vdl.Chimera |
|---|
escape, quote, toString, toXML, toXML, writeAttribute |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private TreeMap m_declareMap
Declare with an optional default value
of type Value.
Declareprivate ArrayList m_profileList
Profileprivate ArrayList m_argumentList
Argument, and can be
optionally addressed by a name.
Argumentprivate String m_argumentSeparator
private TreeMap m_localMap
private ArrayList m_callList
Call| Constructor Detail |
|---|
public Transformation()
public Transformation(String name)
name - is the name of the transformation in the current namespace
and version context.Definition
public Transformation(String namespace,
String name,
String version)
name - is the name of the transformation in the current namespace
and version context.namespace - is the namespace that the transformation resides in.version - is a version number.Definition| Method Detail |
|---|
public int getType()
getType in class DefinitionDefinition.TRANSFORMATION
public void addArgument(Argument vArgument)
throws IndexOutOfBoundsException
vArgument - is the argument to append to the command line
arguments.
IndexOutOfBounds - if the argument does not fit into the list.
IndexOutOfBoundsExceptionArgument
public void addArgument(int index,
Argument vArgument)
throws IndexOutOfBoundsException
index - is the position to insert an argumentvArgument - is the argument to append to the command line
arguments.
IndexOutOfBounds - if the argument does not fit into the list.
IndexOutOfBoundsExceptiongetArgument( int ),
setArgument( int, Argument ),
Argument
public void addCall(Call vCall)
throws IndexOutOfBoundsException
vCall - is the invocation to append to the list of calls.
IndexOutOfBounds - if the argument does not fit into the list.
IndexOutOfBoundsExceptionCall
public void addCall(int index,
Call vCall)
throws IndexOutOfBoundsException
index - is the position to insert an invocationvCall - is the invocation to append to the list of calls.
IndexOutOfBounds - if the argument does not fit into the list.
IndexOutOfBoundsExceptionsetCall( int, Call ),
getCall( int ),
Callpublic void addDeclare(Declare vDeclare)
vDeclare - is the formal argument to add to the declarations.getDeclare( String ),
setDeclare( Declare ),
Declarepublic void addLocal(Local vLocal)
vLocal - is the local variable declaration with value.getLocal( String ),
setLocal( Local ),
Local
public void addProfile(Profile vProfile)
throws IndexOutOfBoundsException
vProfile - is the profile to append to remembered profiles.
IndexOutOfBounds - if the argument does not fit into the list.
IndexOutOfBoundsExceptionProfile
public void addProfile(int index,
Profile vProfile)
throws IndexOutOfBoundsException
index - is the position to insert the definitions into.vProfile - is the profile to append to remembered profiles.
IndexOutOfBounds - if the argument does not fit into the list.
IndexOutOfBoundsExceptiongetProfile( int ),
setProfile( int, Profile ),
Profilepublic Enumeration enumerateArgument()
Argument list.
Argument list.Argument,
Enumerationpublic Enumeration enumerateCall()
Call list.
Call list.Call,
Enumerationpublic Enumeration enumerateDeclare()
Declare map.
Declare list.Declare,
Enumerationpublic Enumeration enumerateLocal()
Local,
Enumerationpublic Enumeration enumerateProfile()
Profile list.
Profile list.Profile,
Enumerationpublic boolean isSimple()
public Argument getArgument(int index)
throws IndexOutOfBoundsException
Argument at an arbitrary position.
index - is the place to look up the element at.
IndexOutOfBoundsException - if the referenced position does
not exist.Argumentpublic Argument[] getArgument()
setArgument( Argument[] ),
Argumentpublic int getArgumentCount()
Argumentpublic List getArgumentList()
setArgument( Collection ),
Argumentpublic String getArgumentSeparator()
Argument
elements.
setArgumentSeparator(String)
public Call getCall(int index)
throws IndexOutOfBoundsException
Call at an arbitrary position.
index - is the place to look up the element at.
IndexOutOfBoundsException - if the referenced position does
not exist.addCall( int, Call ),
setCall( int, Call ),
Callpublic Call[] getCall()
Callpublic int getCallCount()
Callpublic List getCallList()
setCall( Collection ),
Callpublic Declare getDeclare(String name)
name - is the symbolic index and variable name to obtain the
declaration for.
Declare object referenced by the name. May
return null, if there is no such object.addDeclare( Declare ),
setDeclare( Declare ),
Declarepublic Declare[] getDeclare()
Declare,
setDeclare( Declare[] )public int getDeclareCount()
public List getDeclareList()
setDeclare( Collection ),
Declarepublic Map getDeclareMap()
setDeclare( Map ),
Declarepublic Local getLocal(String name)
name - is the variable name to obtain the declaration for.
Local object referenced by the name. May
return null, if there is no such object.addLocal( Local ),
setLocal( Local ),
Localpublic Local[] getLocal()
setLocal( Local[] ),
Localpublic int getLocalCount()
public List getLocalList()
setLocal( Collection ),
Localpublic Map getLocalMap()
setLocal( Map ),
Local
public Profile getProfile(int index)
throws IndexOutOfBoundsException
Profile at an arbitrary position.
index - is the place to look up the element at.
IndexOutOfBoundsException - if the referenced position
does not exist.addProfile( int, Profile ),
setProfile( int, Profile ),
Profilepublic Profile[] getProfile()
Profile
specifications.
setProfile( Profile[] ),
Profilepublic int getProfileCount()
Profilepublic List getProfileList()
Profile specifications.
setProfile( Collection ),
Profilepublic Iterator iterateArgument()
Argument list.
Argument list.Argumentpublic Iterator iterateCall()
Call list.
Call list.Callpublic Iterator iterateDeclare()
Declare map.
Declare list.Declarepublic Iterator iterateLocal()
Declarepublic Iterator iterateProfile()
Profile list.
Profile list.Profilepublic ListIterator listIterateArgument()
Argument list.
Argument list.Argumentpublic ListIterator listIterateCall()
Call list.
Call list.Callpublic ListIterator listIterateProfile()
Profile list.
Profile list.Profilepublic ListIterator listIterateArgument(int start)
Argument list.
start - is the start index
Argument list.Argumentpublic ListIterator listIterateCall(int start)
Call list.
start - is the start index
Call list.Callpublic ListIterator listIterateProfile(int start)
Profile list.
start - is the start index
Profile list.Profilepublic void removeAllArgument()
Argumentpublic void removeAllCall()
Callpublic void removeAllDeclare()
Declarepublic void removeAllLocal()
Localpublic void removeAllProfile()
Profilepublic Argument removeArgument(int index)
index - is the position to remove the argument fragment from.
ArrayIndexOutOfBoundsException - if the index was invalid.Argumentpublic Call removeCall(int index)
index - is the position to remove the call fragment from.
ArrayIndexOutOfBoundsException - if the index was invalid.Callpublic Declare removeDeclare(String name)
name - is the name of the argument to remove
Declarepublic Local removeLocal(String name)
name - is the name of the temporary variable to remove
Localpublic Profile removeProfile(int index)
index - is the position to remove the profile from.
ArrayIndexOutOfBoundsException - if the index was invalid.Profile
public void setArgument(int index,
Argument vArgument)
throws IndexOutOfBoundsException
index - is the position to overwrite the element atvArgument - is the new commandline argument.
IndexOutOfBoundsException - if the position does not exist.Argumentpublic void setArgument(Argument[] argumentArray)
argumentArray - is the new commandline argument array.Argumentpublic void setArgument(Collection arguments)
arguments - is the new commandline argument array.Argumentpublic void setArgumentSeparator(String separator)
Argument elements with new content.
separator - is the new string separating neighbouring arguments.getArgumentSeparator()
public void setCall(int index,
Call vCall)
throws IndexOutOfBoundsException
index - is the position to overwrite the element atvCall - is the new call.
IndexOutOfBoundsException - if the position does not exist.addCall( int, Call ),
getCall( int ),
Callpublic void setCall(Call[] callArray)
callArray - is the new call array.Callpublic void setCall(Collection calls)
calls - is the new call array.Callpublic void setDeclare(Declare vDeclare)
vDeclare - is the declaration to insert or replace.Declare,
Hashtable.put( Object, Object )public void setDeclare(Declare[] declareArray)
declareArray - is the new set of declarations.Declarepublic void setDeclare(Collection declares)
declares - is the new set of declarations.Declarepublic void setDeclare(Map declares)
declares - is the new set of declarations.Declarepublic void setLocal(Local vLocal)
vLocal - is the temporary variable to insert or replace.Local,
Hashtable.put( Object, Object )public void setLocal(Local[] localArray)
localArray - is the new set of local variable declarations.Localpublic void setLocal(Collection locals)
locals - is the new set of temporary variable declarations.Localpublic void setLocal(Map locals)
locals - is the new set of declarations.Local
public void setProfile(int index,
Profile vProfile)
throws IndexOutOfBoundsException
index - is the position to overwrite the profile at.vProfile - is the new profile to use in overwriting.
IndexOutOfBoundsException - if the position does not exist.Profilepublic void setProfile(Profile[] profileArray)
profileArray - is the new list of profiles to use for the job.Profilepublic void setProfile(Collection profiles)
profiles - is the new list of profiles to use for the job.Profilepublic String identify()
identify in class DefinitionObject.hashCode()
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. The stream interface should
be able to handle large elements efficiently.
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.
If a null value is specified, no indentation nor
linefeeds will be generated.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 | |||||||||