org.xmloperator.lambda2.net.impl
Class PentaryMultiplexorImpl

java.lang.Object
  extended byorg.xmloperator.lambda2.term.impl.TermImpl
      extended byorg.xmloperator.lambda2.term.impl.VariableImpl
          extended byorg.xmloperator.lambda2.net.impl.PortImpl
              extended byorg.xmloperator.lambda2.net.impl.CellImpl
                  extended byorg.xmloperator.lambda2.net.impl.PentaryMultiplexorImpl
All Implemented Interfaces:
Cell, PentaryMultiplexor, Port, Term, Variable

public final class PentaryMultiplexorImpl
extends CellImpl
implements PentaryMultiplexor

Multiplexor implementation.


Field Summary
 
Fields inherited from interface org.xmloperator.lambda2.net.model.Cell
INTERACTION_ABSTRACTOR_APPLICATOR, INTERACTION_ANNIHILATION_CONSTRUCTOR, INTERACTION_ANNIHILATION_DUPLICATOR, INTERACTION_ANNIHILATION_ERASER, INTERACTION_APPLICATOR_DECODER, INTERACTION_CONSTRUCTOR_DUPLICATOR, INTERACTION_CONSTRUCTOR_DUPLICATOR_CONTRUCTORS, INTERACTION_DUPLICATING_ABSTRACTOR, INTERACTION_DUPLICATING_APPLICATOR, INTERACTION_DUPLICATING_DECODER, INTERACTION_ERASING_ABSTRACTOR, INTERACTION_ERASING_APPLICATOR, INTERACTION_ERASING_CONSTRUCTOR, INTERACTION_ERASING_DECODER, INTERACTION_ERASING_DUPLICATOR, INTERACTION_MERGING_DECODER, INTERACTION_MERGING_DECODERS, INTERACTION_SYMBOLS, INTERACTION_WIRE, SYMBOL_ABSTRACTOR, SYMBOL_APPLICATOR, SYMBOL_CONSTRUCTOR, SYMBOL_DECODER, SYMBOL_DUPLICATOR, SYMBOL_ERASER, SYMBOL_SYMBOLS, SYMBOL_WIRE
 
Fields inherited from interface org.xmloperator.lambda2.term.model.Term
TYPE_ABSTRACTION, TYPE_APPLICATION, TYPE_VARIABLE
 
Constructor Summary
PentaryMultiplexorImpl(boolean isAbstractionMultiplexor)
           
 
Method Summary
 Cell cloneCell()
          Clones this Cell and returns the clone.
 void collectPorts(Stack portStack)
          Adds its ports to a given Stack.
 Port getBodyPort()
          Returns the body Port of this (de-)multiplexor.
 Port getDuplicatorPort0()
          Returns the Port of this (de-)multiplexor that maps to the Port 0 of a duplicator.
 Port getDuplicatorPort1()
          Returns the Port of this (de-)multiplexor that maps to the Port 1 of a duplicator.
 Port getDuplicatorPort2()
          Returns the Port of this (de-)multiplexor that maps to the Port 2 of a duplicator.
 Port getPort(int portNumber)
          Returns the port with the given number.
 int getSymbol()
          Returns the Symbol SYMBOL_* of this cell.
 int getSymbolArity()
          Returns the symbol arity of this Cell.
 Port getVariablePort()
          Returns the variable Port of this (de-)multiplexor.
 int interact()
          Interacts with the opposite Cell.
 boolean isAbstractionMultiplexor()
          Returns true if this cell is an abstraction multiplexor, false if it is an application de-multiplexor.
 boolean isPentaryMultiplexor()
          Returns true if this Cell is a PentaryMultiplexor, i.e. an Abstractor or an Applicator.
 
Methods inherited from class org.xmloperator.lambda2.net.impl.CellImpl
getPrincipalPort, isBinaryCell, isDecoder, isEraser, isWireCell
 
Methods inherited from class org.xmloperator.lambda2.net.impl.PortImpl
connectTo, disconnect, getCell, getConnectedPort, getPortNumber, isConnected, isFree, isPrincipal
 
Methods inherited from class org.xmloperator.lambda2.term.impl.VariableImpl
getTermType, isVariable
 
Methods inherited from class org.xmloperator.lambda2.term.impl.TermImpl
buildAbstraction, buildAbstraction, buildAbstraction, buildApplication, buildApplication, freeVariables, isAbstraction, isApplication, toString, toText
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xmloperator.lambda2.net.model.Cell
getPrincipalPort, isBinaryCell, isDecoder, isEraser, isWireCell
 
Methods inherited from interface org.xmloperator.lambda2.term.model.Term
buildAbstraction, buildAbstraction, buildAbstraction, buildApplication, buildApplication, freeVariables, isAbstraction, isApplication, toText
 

Constructor Detail

PentaryMultiplexorImpl

public PentaryMultiplexorImpl(boolean isAbstractionMultiplexor)
Method Detail

getSymbol

public final int getSymbol()
Description copied from interface: Cell
Returns the Symbol SYMBOL_* of this cell.

Specified by:
getSymbol in interface Cell
Returns:
the Symbol SYMBOL_* of this cell.

getSymbolArity

public int getSymbolArity()
Description copied from interface: Cell
Returns the symbol arity of this Cell. It is >= 0.

Specified by:
getSymbolArity in interface Cell
Returns:
the symbol arity of this Cell. It is >= 0.

isPentaryMultiplexor

public final boolean isPentaryMultiplexor()
Description copied from interface: Cell
Returns true if this Cell is a PentaryMultiplexor, i.e. an Abstractor or an Applicator.

Specified by:
isPentaryMultiplexor in interface Cell
Overrides:
isPentaryMultiplexor in class CellImpl

getPort

public Port getPort(int portNumber)
Description copied from interface: Cell
Returns the port with the given number.

Specified by:
getPort in interface Cell
Parameters:
portNumber - 0 for the principal port, 1 to the symbol arity for the auxiliary ports.
Returns:
the port with the given number.

collectPorts

public void collectPorts(Stack portStack)
Description copied from interface: Cell
Adds its ports to a given Stack.

Specified by:
collectPorts in interface Cell
Overrides:
collectPorts in class CellImpl

cloneCell

public Cell cloneCell()
Description copied from interface: Cell
Clones this Cell and returns the clone.

Specified by:
cloneCell in interface Cell
Returns:
this Cell and returns the clone.

interact

public final int interact()
Description copied from interface: Cell
Interacts with the opposite Cell.

Pre-condition: the two cells must have their principal Ports connected and have their all auxiliary Ports connected.

Specified by:
interact in interface Cell
Returns:
the interaction type INTERACTION_*.

isAbstractionMultiplexor

public final boolean isAbstractionMultiplexor()
Description copied from interface: PentaryMultiplexor
Returns true if this cell is an abstraction multiplexor, false if it is an application de-multiplexor.

Specified by:
isAbstractionMultiplexor in interface PentaryMultiplexor
Returns:
true if this cell is an abstraction multiplexor, false if it is an application de-multiplexor.

getBodyPort

public final Port getBodyPort()
Description copied from interface: PentaryMultiplexor
Returns the body Port of this (de-)multiplexor.

Specified by:
getBodyPort in interface PentaryMultiplexor
Returns:
the body Port of this (de-)multiplexor.

getVariablePort

public final Port getVariablePort()
Description copied from interface: PentaryMultiplexor
Returns the variable Port of this (de-)multiplexor.

Specified by:
getVariablePort in interface PentaryMultiplexor
Returns:
the variable Port of this (de-)multiplexor.

getDuplicatorPort0

public final Port getDuplicatorPort0()
Description copied from interface: PentaryMultiplexor
Returns the Port of this (de-)multiplexor that maps to the Port 0 of a duplicator.

Specified by:
getDuplicatorPort0 in interface PentaryMultiplexor
Returns:
the Port of this (de-)multiplexor that maps to the Port 0 of a duplicator.

getDuplicatorPort1

public final Port getDuplicatorPort1()
Description copied from interface: PentaryMultiplexor
Returns the Port of this (de-)multiplexor that maps to the Port 1 of a duplicator.

Specified by:
getDuplicatorPort1 in interface PentaryMultiplexor
Returns:
the Port of this (de-)multiplexor that maps to the Port 1 of a duplicator.

getDuplicatorPort2

public final Port getDuplicatorPort2()
Description copied from interface: PentaryMultiplexor
Returns the Port of this (de-)multiplexor that maps to the Port 2 of a duplicator.

Specified by:
getDuplicatorPort2 in interface PentaryMultiplexor
Returns:
the Port of this (de-)multiplexor that maps to the Port 2 of a duplicator.