org.embl.ebi.escience.scufl
Class DataConstraint

java.lang.Object
  extended by org.embl.ebi.escience.scufl.DataConstraint
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class DataConstraint
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable

Represents a data dependancy between two processors

Author:
Tom Oinn
See Also:
Serialized Form

Constructor Summary
DataConstraint(ScuflModel model, Port source, Port sink)
          Create a new data constraint from the source to the sink port.
DataConstraint(ScuflModel model, java.lang.String source_name, java.lang.String sink_name)
          Create a new data constraint from two name strings of the form [PROCESSOR]:[PORT] for source and sink.
 
Method Summary
 int compareTo(java.lang.Object o)
          Use the toString as the comparable
 java.lang.String getName()
          Return a string representation of the data link
 Port getSink()
          Return the sink Port
 Port getSource()
          Return the source Port
 java.lang.String toString()
          Return the name as the toString() method
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataConstraint

public DataConstraint(ScuflModel model,
                      java.lang.String source_name,
                      java.lang.String sink_name)
               throws DataConstraintCreationException,
                      UnknownPortException,
                      UnknownProcessorException,
                      MalformedNameException
Create a new data constraint from two name strings of the form [PROCESSOR]:[PORT] for source and sink. These must exist within the model specified.

Throws:
MalformedNameException - if the name supplied is not in the correct format
DataConstraintCreationException - if the ports are found but are incorrectly typed
UnknownPortException - if the processor is found but doesn't contain the named port
UnknownProcessorException - if the model doesn't contain the particular processor name

DataConstraint

public DataConstraint(ScuflModel model,
                      Port source,
                      Port sink)
               throws DataConstraintCreationException
Create a new data constraint from the source to the sink port. The ports must be instances of OutputPort and InputPort respectively

Throws:
DataConstraintCreationException - if the ports are found but are incorrectly typed
Method Detail

getSource

public Port getSource()
Return the source Port


getSink

public Port getSink()
Return the sink Port


getName

public java.lang.String getName()
Return a string representation of the data link


toString

public java.lang.String toString()
Return the name as the toString() method

Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)
Use the toString as the comparable

Specified by:
compareTo in interface java.lang.Comparable