org.shiwa.fgi.iwir
Class LoopCounter

java.lang.Object
  extended by org.shiwa.fgi.iwir.AbstractPort
      extended by org.shiwa.fgi.iwir.LoopCounter

public class LoopCounter
extends AbstractPort

The Class LoopCounter defines the control flow of the ForTask.


Constructor Summary
LoopCounter(java.lang.String name, java.lang.Integer from, java.lang.Integer to)
          Instantiates a new loop counter.
LoopCounter(java.lang.String name, java.lang.Integer from, java.lang.Integer to, java.lang.Integer step)
          Instantiates a new loop counter.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getFrom()
          Gets the from of the counter.
 AbstractPort getFromPort()
          Returns the from-port if it exist, otherwise returns null.
 java.lang.String getStep()
          Gets the step of the counter.
 AbstractPort getStepPort()
          Returns the step-port if it exist, otherwise null.
 java.lang.String getTo()
          Gets the to of the counter.
 AbstractPort getToPort()
          Returns the to-port if it exist, otherwise null.
 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.
 
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

LoopCounter

public LoopCounter(java.lang.String name,
                   java.lang.Integer from,
                   java.lang.Integer to,
                   java.lang.Integer step)
Instantiates a new loop counter. If the argument for from, to and step is null, an empty string is and a special port is created. Let t be a task. This ports can be accessed using t.getPort("name/{from,to,step}"). For instance,
 t.setLoopCounter(new LoopCounter("name", 1, null, null))
 
is and
 t.getPort("name/to") t.getPort("name/step")
 
can be used to access the attributes via ports.

Parameters:
name - the name of the counter
from - the starting point
to - the end point
step - the step

LoopCounter

public LoopCounter(java.lang.String name,
                   java.lang.Integer from,
                   java.lang.Integer to)
Instantiates a new loop counter. If the argument for from and to is null, an empty string is and a special port is created. Let t be a task. This ports can be accessed using t.getPort("name/{from,to,step}"). For instance,
 t.setLoopCounter(new LoopCounter("name", 1, null))
 
is and
 t.getPort("name/to")
 
can be used to access the attribute via ports.

Parameters:
name - the name of the counter
from - the starting point
to - the end point
Method Detail

getFrom

public java.lang.String getFrom()
Gets the from of the counter.

Returns:
the from of the counter

getTo

public java.lang.String getTo()
Gets the to of the counter.

Returns:
the to of the counter

getStep

public java.lang.String getStep()
Gets the step of the counter. Returns empty string "" if step is not set.

Returns:
the step of the counter

getFromPort

public AbstractPort getFromPort()
Returns the from-port if it exist, otherwise returns null.

Returns:
the from port

getToPort

public AbstractPort getToPort()
Returns the to-port if it exist, otherwise null.

Returns:
the to port

getStepPort

public AbstractPort getStepPort()
Returns the step-port if it exist, otherwise null.

Returns:
the step port

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

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractPort

equals

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