ch.randelshofer.rubik.solver
Class CubeParser
java.lang.Object
ch.randelshofer.rubik.solver.CubeParser
public class CubeParser
- extends java.lang.Object
Parse the cube state passed in on the command line
checking for gross syntax errors. For example, all
9 facelet markings for each of the six sides must
be specified, and markings must be a printable ASCII
character. If the parse was successful a "FaceletCube"
is initialized. The FaceletCube represents the cube
by the markings of the 54 individual facelets. The
FaceletCube can then be asked to validate the cube
to determine if it is in a legal, and thus solvable,
configuration.
This class has been derived from cubepars.cpp and cubepars.h
from the 'Kociemba Cube Solver 1.0' (KCube) (c) Greg Schmidt.
- Version:
- 0.0 2000-07-02
- Author:
- Werner Randelshofer, Hausmatt 10, CH-6045 Immensee, Switzerland
|
Method Summary |
java.lang.String |
getErrorText(int error)
Return the text associated with an error return code. |
int |
parseInput(java.lang.String input,
FaceletCube faceletCube)
Parse the input and initialize a FaceletCube. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VALID
public static final int VALID
- See Also:
- Constant Field Values
INVALID_FACE
public static final int INVALID_FACE
- See Also:
- Constant Field Values
INVALID_MARKER
public static final int INVALID_MARKER
- See Also:
- Constant Field Values
INCOMPLETE_INPUT
public static final int INCOMPLETE_INPUT
- See Also:
- Constant Field Values
SYNTAX_ERROR
public static final int SYNTAX_ERROR
- See Also:
- Constant Field Values
NUMBER_OF_ERRORS
public static final int NUMBER_OF_ERRORS
- See Also:
- Constant Field Values
CubeParser
public CubeParser()
parseInput
public int parseInput(java.lang.String input,
FaceletCube faceletCube)
- Parse the input and initialize a FaceletCube.
getErrorText
public java.lang.String getErrorText(int error)
- Return the text associated with an error return code.