|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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) == cholds 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.
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 |
public static final java.lang.String rcsid
Method Detail |
public Space getSpace()
public java.lang.String getId()
public Cell s(Cell c, int steps, Obs o)
c
- The cellsteps
- Number of steps, can be negative.public void connect(Cell c, Cell d) throws gzz.errors.ZZAlreadyConnectedException
gzz.errors.ZZAlreadyConnectedException
- If one of the cells is
already connected.public void disconnect(Cell c, int dir)
public java.util.Set getHeadcells()
public java.util.Set getNegsides()
public void connect(Cell c, int dir, Cell d) throws gzz.errors.ZZAlreadyConnectedException
gzz.errors.ZZAlreadyConnectedException
public Cell s(Cell c, int steps)
public Cell s(Cell c)
public boolean isCircularHead(Cell c, Obs o)
public Cell h(Cell c, int dir, Obs o)
public Cell h(Cell c, int dir)
public Cell h(Cell c)
public void insert(Cell c, int dir, Cell d) throws gzz.errors.ZZAlreadyConnectedException
c
- The cell next to which to insert the celldir
- The direction from c in which it should be insertedd
- The cell to be inserted.
gzz.errors.ZZAlreadyConnectedException
public void excise(Cell c)
public void hop(Cell c, int steps)
public void insertRank(Cell c, int dir, Cell d)
c
- The cell the rank is to be inserted at.d
- The headcell of the rank to be inserted.
java.lang.IllegalArgumentException
- if d
has a negwards
connection, i.e. is not a headcell, or on a looping rank.public void exciseRange(Cell from, Cell to)
from
- The negmost cell in the range to be excised.to
- The posmost cell in the range to be excised.
java.lang.IllegalArgumentException
- if from
and
to
are not on the same
rank, or not in the correct order.
(XXX Behavior then?)public java.util.Iterator iterator(Cell c)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |