org.xmloperator.lambda2.net.impl
Class EraserCellImpl

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

public final class EraserCellImpl
extends CellImpl
implements Eraser

Eraser 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
EraserCellImpl()
           
 
Method Summary
 Cell cloneCell()
          Clones this Cell and returns the clone.
 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 isEraser()
          Returns true if this Cell is an Eraser.
 
Methods inherited from class org.xmloperator.lambda2.net.impl.CellImpl
collectPorts, getPrincipalPort, isBinaryCell, isDecoder, isPentaryMultiplexor, 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
collectPorts, getPrincipalPort, isBinaryCell, isDecoder, isPentaryMultiplexor, isWireCell
 
Methods inherited from interface org.xmloperator.lambda2.term.model.Term
buildAbstraction, buildAbstraction, buildAbstraction, buildApplication, buildApplication, freeVariables, isAbstraction, isApplication, toText
 

Constructor Detail

EraserCellImpl

public EraserCellImpl()
Method Detail

getSymbol

public 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.

isEraser

public boolean isEraser()
Description copied from interface: Cell
Returns true if this Cell is an Eraser.

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

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 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_*.