org.shiwa.fgi.iwir
Class InputPort

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

public class InputPort
extends AbstractDataPort

The Class InputPort servers as an identifier for the data flow. InputPort has an extra field value. The value can be set and used to evaluate conditions.


Constructor Summary
InputPort(java.lang.String name, DataType type)
          Instantiates a new input port.
InputPort(java.lang.String name, java.lang.String type)
          Instantiates a new input port.
 
Method Summary
 java.lang.String getValue()
          Gets the value in string representation.
 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, equals, getAllSuccessors, getConstraints, getMyTask, getName, getPredecessors, getProperties, getSuccessors, getType, getUniqueId, hashCode, removeProperty, setType, setType, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InputPort

public InputPort(java.lang.String name,
                 DataType type)
Instantiates a new input port.

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

InputPort

public InputPort(java.lang.String name,
                 java.lang.String type)
          throws java.lang.IllegalArgumentException
Instantiates a new input 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