gzz
Interface Dim

gzz.Cell gzz.Dim gzz.Space gzz.CellTexter gzz.VStreamCellTexter gzz.JavaObjector gzz.Obs gzz.ObsTrigger ../../Gzz_CoreAPIs.gen.html#core core_small gzz.Dim gzz.diff.DeltaDim gzz.impl.AbstractDim gzz.impl.SimpleDim gzz.impl.NormalDim ../../Gzz_Backend.gen.html#impldims impldims_small
All Known Implementing Classes:
AbstractDim

public interface Dim

A single ZZ dimension. A dimension connects cells to two directions. It is vital that the identity

	s(c,dir) == null || s(c,dir).s(c,-1) == c
 
holds at each time: this is the underpinning of the ZZ thinking. Of course, the connections may change over time but the identity should still stay true.

See Also:
AbstractDim, TestSimpleDim

Field Summary
static java.lang.String rcsid
           
 
Method Summary
 void connect(Cell c, Cell d)
          Connect the two cells in this dimension, in order.
 void connect(Cell c, int dir, Cell d)
          Connect two cells in direction given.
 void disconnect(Cell c, int dir)
          Disconnect the cell in the given direction.
 void excise(Cell c)
          Remove the given cell from this dimension.
 void exciseRange(Cell from, Cell to)
          Excise a whole range of cells from a rank.
 java.util.Set getHeadcells()
          Get the set of all non-trivial headcells on this dimension.
 java.lang.String getId()
          Get the identifier of this dimension.
 java.util.Set getNegsides()
          Get the set of cells that have posward connections.
 Space getSpace()
          Get the space this dimension is affilated with.
 Cell h(Cell c)
           
 Cell h(Cell c, int dir)
           
 Cell h(Cell c, int dir, Obs o)
          Get headcell.
 void hop(Cell c, int steps)
          Hop the cell along this dimension.
 void insert(Cell c, int dir, Cell d)
          Insert a cell on a rank.
 void insertRank(Cell c, int dir, Cell d)
          Insert a whole rank inside another rank.
 boolean isCircularHead(Cell c, Obs o)
          Whether the given cell is a headcell of a circular rank on this dimension.
 java.util.Iterator iterator(Cell c)
          Iterate starting from the given cell.
 Cell s(Cell c)
           
 Cell s(Cell c, int steps)
           
 Cell s(Cell c, int steps, Obs o)
          Get another cell steps steps on the dimension from c.
 

Field Detail

rcsid

public static final java.lang.String rcsid
See Also:
Constant Field Values
Method Detail

getSpace

public Space getSpace()
Get the space this dimension is affilated with.


getId

public java.lang.String getId()
Get the identifier of this dimension.


s

public Cell s(Cell c,
              int steps,
              Obs o)
Get another cell steps steps on the dimension from c.

Parameters:
c - The cell
steps - Number of steps, can be negative.

connect

public void connect(Cell c,
                    Cell d)
             throws gzz.errors.ZZAlreadyConnectedException
Connect the two cells in this dimension, in order. This method is not allowed to break existing connections.

Throws:
gzz.errors.ZZAlreadyConnectedException - If one of the cells is already connected.

disconnect

public void disconnect(Cell c,
                       int dir)
Disconnect the cell in the given direction. It is not an error to disconnect something that is not connected.


getHeadcells

public java.util.Set getHeadcells()
Get the set of all non-trivial headcells on this dimension. Non-trivial headcells are those with a posward connection, i.e. cells that aren't connected on this dimension aren't returned by this method.


getNegsides

public java.util.Set getNegsides()
Get the set of cells that have posward connections. Only the 'real' cells which should be saved to the file, merged etc., not connections inferred by the computer.


connect

public void connect(Cell c,
                    int dir,
                    Cell d)
             throws gzz.errors.ZZAlreadyConnectedException
Connect two cells in direction given.

gzz.errors.ZZAlreadyConnectedException

s

public Cell s(Cell c,
              int steps)

s

public Cell s(Cell c)

isCircularHead

public boolean isCircularHead(Cell c,
                              Obs o)
Whether the given cell is a headcell of a circular rank on this dimension.


h

public Cell h(Cell c,
              int dir,
              Obs o)
Get headcell. This function must return a cell always, even with circular ranks. In case of a circular rank, picking a cell depends on dimension. Ted recommends that it be user-pickable, especially for normal (user-modifiable) dimensions.


h

public Cell h(Cell c,
              int dir)

h

public Cell h(Cell c)

insert

public void insert(Cell c,
                   int dir,
                   Cell d)
            throws gzz.errors.ZZAlreadyConnectedException
Insert a cell on a rank.

Parameters:
c - The cell next to which to insert the cell
dir - The direction from c in which it should be inserted
d - The cell to be inserted.
gzz.errors.ZZAlreadyConnectedException

excise

public void excise(Cell c)
Remove the given cell from this dimension.


hop

public void hop(Cell c,
                int steps)
Hop the cell along this dimension.


insertRank

public void insertRank(Cell c,
                       int dir,
                       Cell d)
Insert a whole rank inside another rank.

Parameters:
c - The cell the rank is to be inserted at.
d - The headcell of the rank to be inserted.
Throws:
java.lang.IllegalArgumentException - if d has a negwards connection, i.e. is not a headcell, or on a looping rank.

exciseRange

public void exciseRange(Cell from,
                        Cell to)
Excise a whole range of cells from a rank. Makes the excised range an independent, non-looping rank.

Parameters:
from - The negmost cell in the range to be excised.
to - The posmost cell in the range to be excised.
Throws:
java.lang.IllegalArgumentException - if from and to are not on the same rank, or not in the correct order. (XXX Behavior then?)

iterator

public java.util.Iterator iterator(Cell c)
Iterate starting from the given cell. The iterator stops when going back over to c on circular ranks, or at end of ranks for normal ranks. Start from the headcell to go over all cells on the rank once, independent of whether it is circular or not.