INRIA & FluxMedia

fr.fluxmedia.transmorpher.graph
Class TransformationImpl

java.lang.Object
  extended by java.util.Observable
      extended by fr.fluxmedia.transmorpher.graph.TransformationImpl
All Implemented Interfaces:
Transformation
Direct Known Subclasses:
Process, Query, Ruleset

public abstract class TransformationImpl
extends java.util.Observable
implements Transformation

This class is an helper class that implements most of the Transformation interface methods

Since:
jdk 1.3 / SAX 2.0
Author:
Jerome.Euzenat@inrialpes.fr

Field Summary
protected  StringParameters attributes
          The storage object for the attributes of this Transformation instance
protected  PortList inPorts
          The list of in ports
protected  java.lang.String name
          The name of the transformation instance
protected  PortList outPorts
          The list of out ports
protected  Parameters parameters
          The storage object for the parameters of this Transformation instance
protected  Transmorpher transmorpher
          The Transmorpher instance that owns this Transformation
protected  java.lang.String type
          The type of this Transformation instance
 
Constructor Summary
TransformationImpl(java.lang.String name, java.lang.String type, Transmorpher transmorpher)
          Creates an instance of Transformation with a name, a type and the owner of this instance
TransformationImpl(java.lang.String name, java.lang.String type, Transmorpher transmorpher, int nbIn, int nbOut)
          Creates an instance of Transformation with a name, a type and the owner of this instance
 
Method Summary
 void addIn(int index, Port port)
          Adds a new in port at the given index in the storage list
 void addIn(Port port)
          Adds a new in port at the end of the storage list
 void addOut(int i, Port p)
          Adds a new out port at the given index in the storage list
 void addOut(Port port)
          Adds a new out port at the end of the storage list
abstract  void generateJavaCode(Writer file, LinearIndexedStruct externs)
          Prints the Java code for the execution of Transformation instance
abstract  void generateXML()
          Prints the XML expression of the Transformation instance
 StringParameters getAttributes()
          Gets the attributes attribute of the TransformationImpl object
 java.lang.String getName()
          Gets the name attribute of the TransformationImpl object
 Parameters getParameters()
          Gets the parameters attribute of the TransformationImpl object
 Transmorpher getTransmorpher()
          Gets the transmorpher attribute of the TransformationImpl object
 java.lang.String getType()
          Gets the type attribute of the TransformationImpl object
 PortList inPorts()
          Gets the list of in ports
 PortList outPorts()
          Gets the list of out ports
 void retroNull(PortList out, PortList in)
          This is the trivial case if all the output is null then all the input are null *
 void setName(java.lang.String newName)
          When the process name change, we must change the key in transmorpher storage structure.
 void setParameters(Parameters p)
          Sets the parameters attribute of the TransformationImpl object
 void setType(java.lang.String t)
          Sets the type attribute of the TransformationImpl object
 void update(java.lang.Object object)
          This method is used by FlowComposer ( a GUI tool for Transmorpher)
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
The name of the transformation instance


inPorts

protected PortList inPorts
The list of in ports


outPorts

protected PortList outPorts
The list of out ports


parameters

protected Parameters parameters
The storage object for the parameters of this Transformation instance


attributes

protected StringParameters attributes
The storage object for the attributes of this Transformation instance


transmorpher

protected Transmorpher transmorpher
The Transmorpher instance that owns this Transformation


type

protected java.lang.String type
The type of this Transformation instance

Constructor Detail

TransformationImpl

public TransformationImpl(java.lang.String name,
                          java.lang.String type,
                          Transmorpher transmorpher)
Creates an instance of Transformation with a name, a type and the owner of this instance

Parameters:
name - The name of the instance to create
type - The type of the instance to create
transmorpher - The owner of the instance to create

TransformationImpl

public TransformationImpl(java.lang.String name,
                          java.lang.String type,
                          Transmorpher transmorpher,
                          int nbIn,
                          int nbOut)
Creates an instance of Transformation with a name, a type and the owner of this instance

Parameters:
name - The name of the instance to create
type - The type of the instance to create
transmorpher - The owner of the instance to create
nbIn - The number of in ports
nbOut - The number of out ports
Method Detail

getName

public java.lang.String getName()
Gets the name attribute of the TransformationImpl object

Specified by:
getName in interface Transformation
Returns:
The name value

setName

public void setName(java.lang.String newName)
When the process name change, we must change the key in transmorpher storage structure.

Specified by:
setName in interface Transformation
Parameters:
newName - The new name value

getTransmorpher

public Transmorpher getTransmorpher()
Gets the transmorpher attribute of the TransformationImpl object

Specified by:
getTransmorpher in interface Transformation
Returns:
The transmorpher value

getType

public java.lang.String getType()
Gets the type attribute of the TransformationImpl object

Specified by:
getType in interface Transformation
Returns:
The type value

setType

public void setType(java.lang.String t)
Sets the type attribute of the TransformationImpl object

Specified by:
setType in interface Transformation
Parameters:
t - The new type value

setParameters

public void setParameters(Parameters p)
Sets the parameters attribute of the TransformationImpl object

Specified by:
setParameters in interface Transformation
Parameters:
p - The new parameters value

getParameters

public Parameters getParameters()
Gets the parameters attribute of the TransformationImpl object

Specified by:
getParameters in interface Transformation
Returns:
The parameters value

getAttributes

public StringParameters getAttributes()
Gets the attributes attribute of the TransformationImpl object

Specified by:
getAttributes in interface Transformation
Returns:
The attributes value

addIn

public void addIn(Port port)
Adds a new in port at the end of the storage list

Parameters:
port - The in port to add

addIn

public void addIn(int index,
                  Port port)
Adds a new in port at the given index in the storage list

Parameters:
index - The index
port - The port to add

inPorts

public PortList inPorts()
Gets the list of in ports

Specified by:
inPorts in interface Transformation
Returns:
The in port list

addOut

public void addOut(Port port)
Adds a new out port at the end of the storage list

Parameters:
port - The port to add

addOut

public void addOut(int i,
                   Port p)
Adds a new out port at the given index in the storage list

Parameters:
index - The index
port - The port to add

outPorts

public PortList outPorts()
Gets the list of out ports

Specified by:
outPorts in interface Transformation
Returns:
The out port list

generateXML

public abstract void generateXML()
Prints the XML expression of the Transformation instance

Specified by:
generateXML in interface Transformation

generateJavaCode

public abstract void generateJavaCode(Writer file,
                                      LinearIndexedStruct externs)
                               throws java.io.IOException
Prints the Java code for the execution of Transformation instance

Specified by:
generateJavaCode in interface Transformation
Parameters:
file - The writer used for printing java code in a file
externs - The list of external components
Throws:
java.io.IOException - When IO errors occur

retroNull

public void retroNull(PortList out,
                      PortList in)
This is the trivial case if all the output is null then all the input are null *

Specified by:
retroNull in interface Transformation
Parameters:
out - Description of the Parameter
in - Description of the Parameter

update

public void update(java.lang.Object object)
This method is used by FlowComposer ( a GUI tool for Transmorpher)

Specified by:
update in interface Transformation
Parameters:
object - Description of the Parameter

INRIA & FluxMedia

..no bottom yet...