|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Operator node in a lambda-net.
It is either an Eraser, a Delimiter, an Abstractor, an Applicator or a Duplicator.
Each one has a principal Port and may have 1 or 2 auxiliary Ports. By exception, the Eraser has either a principal Port either an auxiliary Port. The principal Port is numbered 0. Auxiliary ports are numbered 1 and 2.
An Operator instance is created by using an OperatorFactory and is terminated by being returned to the same OperatorFactory.
OperatorFactory
Method Summary | |
boolean |
canBeReturnedToFactory()
Returns true if this can be returned to its factory. |
Operator |
cloneOperator(boolean isDirectionInversed)
Creates and return a clone of this Operator. |
OperatorFactory |
getFactory()
Returns the factory of this Operator, which can be used for building compatible Operators. |
int |
getMark()
Operators can be marked for net traversal. |
int |
getOperatorType()
Returns the type of this Operator. |
Port |
getPort(int number)
Returns the Port of this Operator, with the given number. |
Port |
getPort0()
Returns the principal Port of this Operator or null if it doesn't exist. |
Port |
getPort1()
Returns the first auxiliary Port of this Operator or null if it doesn't exist. |
Port |
getPort2()
Returns the second auxiliary Port of this Operator or null if it doesn't exist. |
int |
getPortCount()
Returns the count of ports of this Operator. |
int |
interact(ConnectionListener xListener)
Interacts with the Operator connected on its principal Port. |
boolean |
isAbstractor()
Returns true if this Operator is an Abstractor. |
boolean |
isApplicator()
Returns true if this Operator is an Applicator. |
boolean |
isDelimiter()
Returns true if this Operator is a Delimiter. |
boolean |
isDirectionInversed()
Returns true if the direction of this Operator is inversed. |
boolean |
isDuplicator()
Returns true if this Operator is a Duplicator. |
boolean |
isEraser()
Returns true if this Operator is an Eraser. |
boolean |
isReturnedToFactory()
Returns true if this Operator has been returned to the factory. |
void |
returnToFactory()
Returns this to its Factory. |
void |
setMark(int mark)
Set the mark attached to this operator. |
Field Detail |
public static final int OPERATOR_TYPE_COUNT
public static final int TYPE_ERASER
public static final int TYPE_DELIMITER
public static final int TYPE_ABSTRACTOR
public static final int TYPE_APPLICATOR
public static final int TYPE_DUPLICATOR
public static final java.lang.String[] OPERATOR_TYPE_NAMES
public static final int INTERACTION_TYPE_COUNT
public static final int INTERACTION_BETA_REDUCTION
public static final int INTERACTION_BETA_IDENTITY
public static final int INTERACTION_EXTRUDE_ABSTRACTOR
public static final int INTERACTION_EXTRUDE_IDENTITY
public static final int INTERACTION_EXTRUDE_CLOSED_ABSTRACTOR
public static final int INTERACTION_EXTRUDE_APPLICATOR
public static final int INTERACTION_EXTRUDE_DUPLICATOR
public static final int INTERACTION_ANNIHILATE_ERASER
public static final int INTERACTION_ANNIHILATE_DELIMITER
public static final int INTERACTION_ANNIHILATE_DUPLICATOR
public static final int INTERACTION_COMMUTE_DELIMITER
public static final int INTERACTION_COMMUTE_DUPLICATOR
public static final int INTERACTION_DUPLICATE_ABSTRACTOR
public static final int INTERACTION_DUPLICATE_IDENTITY
public static final int INTERACTION_DUPLICATE_APPLICATOR
public static final int INTERACTION_ERASE_DELIMITER
public static final int INTERACTION_ERASE_ABSTRACTOR
public static final int INTERACTION_ERASE_IDENTITY
public static final int INTERACTION_ERASE_APPLICATOR
public static final int INTERACTION_ERASE_DUPLICATOR
public static final java.lang.String[] INTERACTION_TYPE_NAMES
Method Detail |
public OperatorFactory getFactory()
public boolean isReturnedToFactory()
It must be avoided to keep a reference to an Operator that has been returned to the factory.
This method is the only one that is allowed to call if this Operator has been returned to the factory.
public boolean canBeReturnedToFactory()
If this is connected then this cannot be returned to factory. It may exist other required conditions for being returnable.
public void returnToFactory()
Pre-condition: this can be returned to the factory.
Post-condition: this is no more usable.
java.lang.IllegalStateException
- if this cannot be returned to the factory.public int getPortCount()
public int getOperatorType()
public boolean isEraser()
public boolean isDelimiter()
public boolean isAbstractor()
public boolean isApplicator()
public boolean isDuplicator()
public Port getPort(int number)
number
- the Port number = 0, 1 or 2.
java.lang.IllegalArgumentException
- if the number is neither 0, 1 nor 2.public Port getPort0()
public Port getPort1()
public Port getPort2()
public int getMark()
public void setMark(int mark)
mark
- a mark.public boolean isDirectionInversed()
public Operator cloneOperator(boolean isDirectionInversed)
isDirectionInversed
- if true then the the clone Operator
direction will be inversed (independently from the ditection of this
Operator).
public int interact(ConnectionListener xListener)
Pre-conditions:
Post-conditions:
xListener
- a ConnectionListener for notifying principal connections
other than beta.
java.lang.NullPointerException
- if the principal Port is not connected or
if the interaction meets a free Port.
org.xmloperator.lambda.net.exception.AuxiliaryPortException
- if the connected Port is not a principal Port.
org.xmloperator.lambda.net.exception.MarkedDifferentlyException
- if a connected Operator has not the same mark.
org.xmloperator.lambda.net.exception.UnexpectedAnnihilationException
- if the interacting Operators are two Abstractors or two Applicators.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |