org.shiwa.fgi.iwir
Class LoopPort

java.lang.Object
  extended by org.shiwa.fgi.iwir.AbstractPort
      extended by org.shiwa.fgi.iwir.AbstractDataPort
          extended by org.shiwa.fgi.iwir.LoopPort

public class LoopPort
extends AbstractDataPort

The Class LoopPort is used to express a cyclic data flow. LoopPort has an extra field value. The value can be set and used to evaluate conditions.


Constructor Summary
LoopPort(java.lang.String name, DataType type)
          Instantiates a new loop port.
LoopPort(java.lang.String name, java.lang.String type)
          Instantiates a new loop port.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 AbstractDataPort getInitSource()
          Gets the initial source of the loop port.
 AbstractDataPort getLoopSource()
          Gets the loop source of the loop port.
 java.lang.String getValue()
          Gets the value in string representation.
 int hashCode()
           
 boolean isInputPort()
          Checks if the port is an instance of ONE OF the input ports.
 boolean isOutputPort()
          Checks if the port is an instance of ONE OF the output ports.
 void setValue(boolean b)
          Sets the boolean value for the port.
 void setValue(double d)
          Sets the double value for the port.
 void setValue(int i)
          Sets the integer value for the port.
 void setValue(java.lang.String s)
          Sets the string value for the port.
 
Methods inherited from class org.shiwa.fgi.iwir.AbstractPort
addConstraint, addProperty, getAllSuccessors, getConstraints, getMyTask, getName, getPredecessors, getProperties, getSuccessors, getType, getUniqueId, removeProperty, setType, setType, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoopPort

public LoopPort(java.lang.String name,
                DataType type)
Instantiates a new loop port.

Parameters:
name - the name of the loop port
type - the type of the loop port

LoopPort

public LoopPort(java.lang.String name,
                java.lang.String type)
         throws java.lang.IllegalArgumentException
Instantiates a new loop port.

Parameters:
name - the name
type - the type
Throws:
java.lang.IllegalArgumentException - if the type is not valid
Method Detail

setValue

public void setValue(java.lang.String s)
Sets the string value for the port. Is used ONLY to evaluate conditions. Throws an IllegalArgumentException if string is not the type of the port.

Parameters:
s - the new value

setValue

public void setValue(double d)
Sets the double value for the port. Is used ONLY to evaluate conditions. Throws an IllegalArgumentException if double is not the type of the port.

Parameters:
d - the double value

setValue

public void setValue(int i)
Sets the integer value for the port. Is used ONLY to evaluate conditions. Throws an IllegalArgumentException if integer is not the type of the port.

Parameters:
i - the integer value

setValue

public void setValue(boolean b)
Sets the boolean value for the port. Is used ONLY to evaluate conditions. Throws an IllegalArgumentException if boolean is not the type of the port.

Parameters:
b - the boolean value

getValue

public java.lang.String getValue()
Gets the value in string representation.

Returns:
the value

isInputPort

public boolean isInputPort()
Description copied from class: AbstractPort
Checks if the port is an instance of ONE OF the input ports.

Specified by:
isInputPort in class AbstractPort
Returns:
true, if is input port

isOutputPort

public boolean isOutputPort()
Description copied from class: AbstractPort
Checks if the port is an instance of ONE OF the output ports.

Specified by:
isOutputPort in class AbstractPort
Returns:
true, if is output port

getInitSource

public AbstractDataPort getInitSource()
                               throws NotWellFormedException
Gets the initial source of the loop port. Return null if the compound task is a top-level task and the loop port has no source port.

Returns:
the initial the source
Throws:
NotWellFormedException - if the data flow is invalid

getLoopSource

public AbstractDataPort getLoopSource()
                               throws NotWellFormedException
Gets the loop source of the loop port.

Returns:
the loop source
Throws:
NotWellFormedException - if the data flow is invalid

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractPort

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class AbstractPort