CubeTwister 2.0alpha142 2012-02-11

ch.randelshofer.rubik.solver
Class CubeParser

java.lang.Object
  extended by 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

Field Summary
static int INCOMPLETE_INPUT
           
static int INVALID_FACE
           
static int INVALID_MARKER
           
static int NUMBER_OF_ERRORS
           
static int SYNTAX_ERROR
           
static int VALID
           
 
Constructor Summary
CubeParser()
           
 
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
 

Field Detail

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
Constructor Detail

CubeParser

public CubeParser()
Method Detail

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.


(c) Werner Randelshofer.
All rights reserved.