org.xmloperator.lambda2.net.impl
Class WireCellImpl

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.WireCellImpl
All Implemented Interfaces:
Cell, Port, Term, Variable, WireCell

public final class WireCellImpl
extends CellImpl
implements WireCell

Wire cell 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
WireCellImpl()
           
 
Method Summary
 Cell cloneCell()
          Clones this Cell and returns the clone.
 void collectPorts(Stack portStack)
          Adds its ports to a given Stack.
 Port getAuxiliaryPort()
          Returns the auxiliary Port of this wire Cell.
 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.
 int interact()
          Interacts with the opposite Cell.
 boolean isWireCell()
          Returns true if this Cell is a WireCell.
 
Methods inherited from class org.xmloperator.lambda2.net.impl.CellImpl
getPrincipalPort, isBinaryCell, isDecoder, isEraser, isPentaryMultiplexor
 
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, isPentaryMultiplexor
 
Methods inherited from interface org.xmloperator.lambda2.term.model.Term
buildAbstraction, buildAbstraction, buildAbstraction, buildApplication, buildApplication, freeVariables, isAbstraction, isApplication, toText
 

Constructor Detail

WireCellImpl

public WireCellImpl()
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.

isWireCell

public final boolean isWireCell()
Description copied from interface: Cell
Returns true if this Cell is a WireCell.

Specified by:
isWireCell in interface Cell
Overrides:
isWireCell 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_*.

getAuxiliaryPort

public final Port getAuxiliaryPort()
Description copied from interface: WireCell
Returns the auxiliary Port of this wire Cell.

Specified by:
getAuxiliaryPort in interface WireCell
Returns:
the auxiliary Port of this wire Cell.