org.xmloperator.lambda2.net.model
Interface Cell

All Known Subinterfaces:
BinaryCell, Decoder, Eraser, PentaryMultiplexor, WireCell
All Known Implementing Classes:
BinaryCellImpl, CellImpl, DecoderImpl, EraserCellImpl, PentaryMultiplexorImpl, WireCellImpl

public interface Cell

A cell has a principal port and zero or more auxiliary ports.


Field Summary
static int INTERACTION_ABSTRACTOR_APPLICATOR
           
static int INTERACTION_ANNIHILATION_CONSTRUCTOR
           
static int INTERACTION_ANNIHILATION_DUPLICATOR
           
static int INTERACTION_ANNIHILATION_ERASER
           
static int INTERACTION_APPLICATOR_DECODER
           
static int INTERACTION_CONSTRUCTOR_DUPLICATOR
           
static int INTERACTION_CONSTRUCTOR_DUPLICATOR_CONTRUCTORS
           
static int INTERACTION_DUPLICATING_ABSTRACTOR
           
static int INTERACTION_DUPLICATING_APPLICATOR
           
static int INTERACTION_DUPLICATING_DECODER
           
static int INTERACTION_ERASING_ABSTRACTOR
           
static int INTERACTION_ERASING_APPLICATOR
           
static int INTERACTION_ERASING_CONSTRUCTOR
           
static int INTERACTION_ERASING_DECODER
           
static int INTERACTION_ERASING_DUPLICATOR
           
static int INTERACTION_MERGING_DECODER
           
static int INTERACTION_MERGING_DECODERS
           
static java.lang.String[] INTERACTION_SYMBOLS
           
static int INTERACTION_WIRE
           
static int SYMBOL_ABSTRACTOR
           
static int SYMBOL_APPLICATOR
           
static int SYMBOL_CONSTRUCTOR
           
static int SYMBOL_DECODER
           
static int SYMBOL_DUPLICATOR
           
static int SYMBOL_ERASER
           
static char[] SYMBOL_SYMBOLS
           
static int SYMBOL_WIRE
           
 
Method Summary
 Cell cloneCell()
          Clones this Cell and returns the clone.
 void collectPorts(Stack portStack)
          Adds its ports to a given Stack.
 Port getPort(int portNumber)
          Returns the port with the given number.
 Port getPrincipalPort()
          Returns the principal port of this cell.
 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 isBinaryCell()
          Returns true if this Cell is a binaryCell, i.e. a constructor or a duplicator.
 boolean isDecoder()
          Returns true if this Cell is a DecodingCell.
 boolean isEraser()
          Returns true if this Cell is an Eraser.
 boolean isPentaryMultiplexor()
          Returns true if this Cell is a PentaryMultiplexor, i.e. an Abstractor or an Applicator.
 boolean isWireCell()
          Returns true if this Cell is a WireCell.
 

Field Detail

SYMBOL_WIRE

public static final int SYMBOL_WIRE
See Also:
Constant Field Values

SYMBOL_ERASER

public static final int SYMBOL_ERASER
See Also:
Constant Field Values

SYMBOL_DUPLICATOR

public static final int SYMBOL_DUPLICATOR
See Also:
Constant Field Values

SYMBOL_CONSTRUCTOR

public static final int SYMBOL_CONSTRUCTOR
See Also:
Constant Field Values

SYMBOL_ABSTRACTOR

public static final int SYMBOL_ABSTRACTOR
See Also:
Constant Field Values

SYMBOL_APPLICATOR

public static final int SYMBOL_APPLICATOR
See Also:
Constant Field Values

SYMBOL_DECODER

public static final int SYMBOL_DECODER
See Also:
Constant Field Values

SYMBOL_SYMBOLS

public static final char[] SYMBOL_SYMBOLS

INTERACTION_WIRE

public static final int INTERACTION_WIRE
See Also:
Constant Field Values

INTERACTION_ANNIHILATION_ERASER

public static final int INTERACTION_ANNIHILATION_ERASER
See Also:
Constant Field Values

INTERACTION_ERASING_DUPLICATOR

public static final int INTERACTION_ERASING_DUPLICATOR
See Also:
Constant Field Values

INTERACTION_ERASING_CONSTRUCTOR

public static final int INTERACTION_ERASING_CONSTRUCTOR
See Also:
Constant Field Values

INTERACTION_ERASING_ABSTRACTOR

public static final int INTERACTION_ERASING_ABSTRACTOR
See Also:
Constant Field Values

INTERACTION_ERASING_APPLICATOR

public static final int INTERACTION_ERASING_APPLICATOR
See Also:
Constant Field Values

INTERACTION_ERASING_DECODER

public static final int INTERACTION_ERASING_DECODER
See Also:
Constant Field Values

INTERACTION_ANNIHILATION_DUPLICATOR

public static final int INTERACTION_ANNIHILATION_DUPLICATOR
See Also:
Constant Field Values

INTERACTION_ANNIHILATION_CONSTRUCTOR

public static final int INTERACTION_ANNIHILATION_CONSTRUCTOR
See Also:
Constant Field Values

INTERACTION_CONSTRUCTOR_DUPLICATOR

public static final int INTERACTION_CONSTRUCTOR_DUPLICATOR
See Also:
Constant Field Values

INTERACTION_CONSTRUCTOR_DUPLICATOR_CONTRUCTORS

public static final int INTERACTION_CONSTRUCTOR_DUPLICATOR_CONTRUCTORS
See Also:
Constant Field Values

INTERACTION_DUPLICATING_ABSTRACTOR

public static final int INTERACTION_DUPLICATING_ABSTRACTOR
See Also:
Constant Field Values

INTERACTION_DUPLICATING_APPLICATOR

public static final int INTERACTION_DUPLICATING_APPLICATOR
See Also:
Constant Field Values

INTERACTION_ABSTRACTOR_APPLICATOR

public static final int INTERACTION_ABSTRACTOR_APPLICATOR
See Also:
Constant Field Values

INTERACTION_DUPLICATING_DECODER

public static final int INTERACTION_DUPLICATING_DECODER
See Also:
Constant Field Values

INTERACTION_MERGING_DECODER

public static final int INTERACTION_MERGING_DECODER
See Also:
Constant Field Values

INTERACTION_MERGING_DECODERS

public static final int INTERACTION_MERGING_DECODERS
See Also:
Constant Field Values

INTERACTION_APPLICATOR_DECODER

public static final int INTERACTION_APPLICATOR_DECODER
See Also:
Constant Field Values

INTERACTION_SYMBOLS

public static final java.lang.String[] INTERACTION_SYMBOLS
Method Detail

getSymbol

public int getSymbol()
Returns the Symbol SYMBOL_* of this cell.

Returns:
the Symbol SYMBOL_* of this cell.

getSymbolArity

public int getSymbolArity()
Returns the symbol arity of this Cell. It is >= 0.

Returns:
the symbol arity of this Cell. It is >= 0.

isWireCell

public boolean isWireCell()
Returns true if this Cell is a WireCell.

Returns:
true if this Cell is a WireCell.

isEraser

public boolean isEraser()
Returns true if this Cell is an Eraser.

Returns:
true if this Cell is an Eraser.

isBinaryCell

public boolean isBinaryCell()
Returns true if this Cell is a binaryCell, i.e. a constructor or a duplicator.

Returns:
true if this Cell is a binaryCell, i.e. a constructor or a duplicator.

isPentaryMultiplexor

public boolean isPentaryMultiplexor()
Returns true if this Cell is a PentaryMultiplexor, i.e. an Abstractor or an Applicator.

Returns:
true if this Cell is a PentaryMultiplexor, i.e. an Abstractor or an Applicator.

isDecoder

public boolean isDecoder()
Returns true if this Cell is a DecodingCell.

Returns:
true if this Cell is a DecodingCell.

getPrincipalPort

public Port getPrincipalPort()
Returns the principal port of this cell. This an alias for getPort(0).

Returns:
the principal port of this cell. This an alias for getPort(0).

getPort

public Port getPort(int portNumber)
Returns the port with the given number.

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)
Adds its ports to a given Stack.

Parameters:
portStack - a Stack of ports.

cloneCell

public Cell cloneCell()
Clones this Cell and returns the clone.

Returns:
this Cell and returns the clone.

interact

public int interact()
Interacts with the opposite Cell.

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

Returns:
the interaction type INTERACTION_*.
Throws:
java.lang.IllegalStateException - if this Cell is not connected to a principal Port.