org.shiwa.fgi.iwir
Class AbstractPort

java.lang.Object
  extended by org.shiwa.fgi.iwir.AbstractPort
Direct Known Subclasses:
AbstractDataPort, LoopCounter

public abstract class AbstractPort
extends java.lang.Object

The Class AbstractPort represents a port. A port has a name a type optional properties and constraints.


Constructor Summary
AbstractPort(java.lang.String name)
          Instantiates a new abstract port.
 
Method Summary
 void addConstraint(Constraint constraint)
          Adds an additional constraint to the port.
 void addProperty(Property property)
          Adds an additional property to the port.
 boolean equals(java.lang.Object obj)
           
 java.util.List<AbstractPort> getAllSuccessors()
          Gets the all successors of a port.
 java.util.List<Constraint> getConstraints()
          Returns a shallow copy of the port constraints.
 AbstractTask getMyTask()
          Gets the my task.
 java.lang.String getName()
          Gets the name of the port.
 java.util.List<AbstractPort> getPredecessors()
          Gets a list of predecessors.
 java.util.List<Property> getProperties()
          Returns a shallow copy of the port properties.
 java.util.List<AbstractPort> getSuccessors()
          Gets a list of successors.
 DataType getType()
          Gets the type oft the port.
 java.lang.String getUniqueId()
          Returns path+name, representing an unique identifier.
 int hashCode()
           
abstract  boolean isInputPort()
          Checks if the port is an instance of ONE OF the input ports.
abstract  boolean isOutputPort()
          Checks if the port is an instance of ONE OF the output ports.
 void removeProperty(Property p)
          Removes the given property from the list.
 void setType(DataType type)
          Sets the type of the port.
 void setType(java.lang.String type)
          Sets the type of the port.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractPort

public AbstractPort(java.lang.String name)
             throws NotWellFormedException
Instantiates a new abstract port. A valid name should not be equal to condition tokens like integer. Further, no following symbols are disallowed: )(

Parameters:
name - the name
Throws:
NotWellFormedException - if the name is not valid
See Also:
ConditionToken.isValidPortName(String)
Method Detail

getName

public java.lang.String getName()
Gets the name of the port.

Returns:
the name of the port.

addConstraint

public void addConstraint(Constraint constraint)
                   throws NotWellFormedException
Adds an additional constraint to the port. Throws a NotWellFormedException if constrain already exist, for example.

Parameters:
constraint - the new constraint to add
Throws:
NotWellFormedException

addProperty

public void addProperty(Property property)
                 throws NotWellFormedException
Adds an additional property to the port. Throws a NotWellFormedException if constrain already exist, for example.

Parameters:
property - the new property to add
Throws:
NotWellFormedException

removeProperty

public void removeProperty(Property p)
Removes the given property from the list.

Parameters:
p - property to remove

getConstraints

public java.util.List<Constraint> getConstraints()
Returns a shallow copy of the port constraints. Returns an empty list if no constraints exist.

Returns:
the constraints of the port

getProperties

public java.util.List<Property> getProperties()
Returns a shallow copy of the port properties. Returns an empty list if no properties exist.

Returns:
the properties of the port

getPredecessors

public java.util.List<AbstractPort> getPredecessors()
Gets a list of predecessors. Returns an empty list if there exist no predecessors.

Returns:
the predecessors

getSuccessors

public java.util.List<AbstractPort> getSuccessors()
Gets a list of successors. Returns an empty list if there exist no successors.

Returns:
the successors

getAllSuccessors

public java.util.List<AbstractPort> getAllSuccessors()
Gets the all successors of a port. Returns an empty list if there exist no successors.

Returns:
the all successors

getUniqueId

public java.lang.String getUniqueId()
Returns path+name, representing an unique identifier.

Returns:
the unique id

getType

public DataType getType()
Gets the type oft the port.

Returns:
the type of the port

isInputPort

public abstract boolean isInputPort()
Checks if the port is an instance of ONE OF the input ports.

Returns:
true, if is input port

isOutputPort

public abstract boolean isOutputPort()
Checks if the port is an instance of ONE OF the output ports.

Returns:
true, if is output port

getMyTask

public AbstractTask getMyTask()
Gets the my task.

Returns:
the my task

setType

public void setType(java.lang.String type)
Sets the type of the port.

Parameters:
type - the type of the port.

setType

public void setType(DataType type)
Sets the type of the port.

Parameters:
type - the type of the port.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
getUniqueId()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

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