com.hdcookbook.grin.io.builders
Class VisualRCHandlerCell.StateRefCell

java.lang.Object
  extended by com.hdcookbook.grin.io.builders.VisualRCHandlerCell
      extended by com.hdcookbook.grin.io.builders.VisualRCHandlerCell.StateRefCell
Enclosing class:
VisualRCHandlerCell

public static class VisualRCHandlerCell.StateRefCell
extends VisualRCHandlerCell


Nested Class Summary
 
Nested classes/interfaces inherited from class com.hdcookbook.grin.io.builders.VisualRCHandlerCell
VisualRCHandlerCell.ActivateCell, VisualRCHandlerCell.LocationRefCell, VisualRCHandlerCell.NullCell, VisualRCHandlerCell.StateCell, VisualRCHandlerCell.StateRefCell, VisualRCHandlerCell.WallCell
 
Field Summary
 
Fields inherited from class com.hdcookbook.grin.io.builders.VisualRCHandlerCell
alternate, helper
 
Method Summary
 java.lang.String addState(java.util.Map<java.lang.String,java.lang.Integer> stateMap, java.util.Set<java.lang.String> dupCheck, java.util.Map<java.lang.String,VisualRCHandlerCell> cellMap)
          Add the state referred to by this cell to the map of states.
 java.lang.String check()
          Check that this cell is OK.
 java.lang.String getName()
           
 VisualRCHandlerCell getRefersTo()
          Get the cell that this cell refers to.
 java.lang.String getState()
          Get the name of the state of this cell, or that this cell refers to.
 int getStateNumber(java.util.Map<java.lang.String,java.lang.Integer> states, java.lang.String stateFrom)
          Get the integer number of this state within the states map when navigating to this cell from the numbered state.
 
Methods inherited from class com.hdcookbook.grin.io.builders.VisualRCHandlerCell
getRightLeft, getUpDown, newActivate, newLocationRef, newNull, newState, newStateRef, newWall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRefersTo

public VisualRCHandlerCell getRefersTo()
Description copied from class: VisualRCHandlerCell
Get the cell that this cell refers to. Returns null if this cell doesn't refer to another cell, e.g. because it's a state or an .

Specified by:
getRefersTo in class VisualRCHandlerCell

addState

public java.lang.String addState(java.util.Map<java.lang.String,java.lang.Integer> stateMap,
                                 java.util.Set<java.lang.String> dupCheck,
                                 java.util.Map<java.lang.String,VisualRCHandlerCell> cellMap)
Description copied from class: VisualRCHandlerCell
Add the state referred to by this cell to the map of states. Calling this method multiple times on the same cell has no effect.

Specified by:
addState in class VisualRCHandlerCell
Returns:
null if OK, or an error message if not

getName

public java.lang.String getName()

getState

public java.lang.String getState()
Description copied from class: VisualRCHandlerCell
Get the name of the state of this cell, or that this cell refers to. Returns a synthetic value for activate, wall or null cells.

Specified by:
getState in class VisualRCHandlerCell

getStateNumber

public int getStateNumber(java.util.Map<java.lang.String,java.lang.Integer> states,
                          java.lang.String stateFrom)
                   throws java.io.IOException
Description copied from class: VisualRCHandlerCell
Get the integer number of this state within the states map when navigating to this cell from the numbered state.

Specified by:
getStateNumber in class VisualRCHandlerCell
Throws:
java.io.IOException - if there's an error in the grid construction

check

public java.lang.String check()
Description copied from class: VisualRCHandlerCell
Check that this cell is OK. This is called after the cell is completely initialized.

Specified by:
check in class VisualRCHandlerCell
Returns:
null if OK, or an error message if not