org.xmloperator.lambda.net.model
Interface Port


public interface Port

Port of an Operator in a lambda-net.

See Also:
Operator

Field Summary
static int PORT_TYPE_COUNT
           
static int TYPE_ABSTRACTOR_BIND
           
static int TYPE_ABSTRACTOR_BODY
           
static int TYPE_ABSTRACTOR_INPUT
           
static int TYPE_APPLICATOR_ARGUMENT
           
static int TYPE_APPLICATOR_BODY
           
static int TYPE_APPLICATOR_INPUT
           
static int TYPE_DELIMITER_BODY
           
static int TYPE_DELIMITER_INPUT
           
static int TYPE_DUPLICATOR_INPUT1
           
static int TYPE_DUPLICATOR_INPUT2
           
static int TYPE_DUPLICATOR_OUTPUT
           
static int TYPE_ERASER_PORT
           
 
Method Summary
 void connectTo(Port connectedPort)
          Connect this Port to a another Port.
 void disconnect()
          Disconnect this Port.
 Port getConnectedPort()
          Returns the connected Port if any, null elsewhere.
 int getNumber()
          Returns the number of this Port.
 Operator getOperator()
          Returns the Operator to which this Port belongs.
 int getPortType()
          Returns the type of this Port.
 boolean isFirstAuxiliary()
          Returns true if this Port is the first auxiliary Port of its Operator.
 boolean isInput()
          Returns true if this Port is an input Port, false if it is an output Port.
 boolean isPrincipal()
          Returns true if this Port is the principal one of its Operator.
 boolean isSecondAuxiliary()
          Returns true if this Port is the second auxiliary Port of its Operator.
 

Field Detail

PORT_TYPE_COUNT

public static final int PORT_TYPE_COUNT
See Also:
Constant Field Values

TYPE_ERASER_PORT

public static final int TYPE_ERASER_PORT
See Also:
Constant Field Values

TYPE_DELIMITER_INPUT

public static final int TYPE_DELIMITER_INPUT
See Also:
Constant Field Values

TYPE_DELIMITER_BODY

public static final int TYPE_DELIMITER_BODY
See Also:
Constant Field Values

TYPE_ABSTRACTOR_INPUT

public static final int TYPE_ABSTRACTOR_INPUT
See Also:
Constant Field Values

TYPE_ABSTRACTOR_BODY

public static final int TYPE_ABSTRACTOR_BODY
See Also:
Constant Field Values

TYPE_ABSTRACTOR_BIND

public static final int TYPE_ABSTRACTOR_BIND
See Also:
Constant Field Values

TYPE_APPLICATOR_INPUT

public static final int TYPE_APPLICATOR_INPUT
See Also:
Constant Field Values

TYPE_APPLICATOR_BODY

public static final int TYPE_APPLICATOR_BODY
See Also:
Constant Field Values

TYPE_APPLICATOR_ARGUMENT

public static final int TYPE_APPLICATOR_ARGUMENT
See Also:
Constant Field Values

TYPE_DUPLICATOR_INPUT1

public static final int TYPE_DUPLICATOR_INPUT1
See Also:
Constant Field Values

TYPE_DUPLICATOR_INPUT2

public static final int TYPE_DUPLICATOR_INPUT2
See Also:
Constant Field Values

TYPE_DUPLICATOR_OUTPUT

public static final int TYPE_DUPLICATOR_OUTPUT
See Also:
Constant Field Values
Method Detail

getPortType

public int getPortType()
Returns the type of this Port.

Returns:
the type of this Port. It is one of the constants TYPE_*.

getOperator

public Operator getOperator()
Returns the Operator to which this Port belongs.

Returns:
the Operator to which this Port belongs.

getNumber

public int getNumber()
Returns the number of this Port. It may depend on the Operator orientation.

Returns:
the number of this Port. This one of the Operator.NUMBER_* constants.

isPrincipal

public boolean isPrincipal()
Returns true if this Port is the principal one of its Operator.

Returns:
true if this Port is the principal one of its Operator.

isFirstAuxiliary

public boolean isFirstAuxiliary()
Returns true if this Port is the first auxiliary Port of its Operator.

Returns:
true if this Port is the first auxiliary Port of its Operator.

isSecondAuxiliary

public boolean isSecondAuxiliary()
Returns true if this Port is the second auxiliary Port of its Operator.

Returns:
true if this Port is the second auxiliary Port of its Operator.

isInput

public boolean isInput()
Returns true if this Port is an input Port, false if it is an output Port.

Returns:
true if this Port is an input Port, false if it is an output Port.

getConnectedPort

public Port getConnectedPort()
Returns the connected Port if any, null elsewhere.

Returns:
the connected Port if any, null elsewhere.

connectTo

public void connectTo(Port connectedPort)
Connect this Port to a another Port. If connected, disconnecting is required before connecting to another Port.

Parameters:
connectedPort - a Port to connect.
Throws:
org.xmloperator.lambda.net.exception.AlreadyConnectedException - on trying to connect two Ports whose one or the two ones are already connected.
java.lang.IllegalArgumentException - if the given Port is null or itself.
org.xmloperator.lambda.net.exception.SameTypePortException - if the given Port has the same type (input or output) than this Port.

disconnect

public void disconnect()
Disconnect this Port.