CubeTwister 2.0alpha142 2012-02-11

ch.randelshofer.rubik.solver
Class FaceletCube

java.lang.Object
  extended by ch.randelshofer.rubik.solver.FaceletCube

public class FaceletCube
extends java.lang.Object

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 facecube.cpp and facecube.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 B
           
static int D
           
static int DUPLICATE_CENTER_MARKING
           
static int F
           
static int INVALID_CORNER_MARKINGS
           
static int INVALID_CORNER_PARITY
           
static int INVALID_EDGE_MARKINGS
           
static int INVALID_EDGE_PARITY
           
static int INVALID_FACELETCOUNT
           
static int INVALID_MARKER
           
static int INVALID_TOTAL_PARITY
           
static int L
           
static int NUMBER_OF_ERRORS
           
static int R
           
static int U
           
static int VALID
           
 
Constructor Summary
FaceletCube()
          Default constructor.
 
Method Summary
 void dump()
          Dump cube state.
 int faceNameToOffset(char faceName)
          Convert face name to enumeration offset.
 java.lang.String getErrorText(int error)
          Return the text associated with an error return code.
 void setFaceMarkings(int face, char[] markings)
          Set the cube markings for a given face.
 java.lang.String toString()
           
 int validate(Cube cube)
          Validate markings, permutation, and parity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

U

public static final int U
See Also:
Constant Field Values

D

public static final int D
See Also:
Constant Field Values

L

public static final int L
See Also:
Constant Field Values

R

public static final int R
See Also:
Constant Field Values

F

public static final int F
See Also:
Constant Field Values

B

public static final int B
See Also:
Constant Field Values

VALID

public static final int VALID
See Also:
Constant Field Values

INVALID_MARKER

public static final int INVALID_MARKER
See Also:
Constant Field Values

INVALID_FACELETCOUNT

public static final int INVALID_FACELETCOUNT
See Also:
Constant Field Values

DUPLICATE_CENTER_MARKING

public static final int DUPLICATE_CENTER_MARKING
See Also:
Constant Field Values

INVALID_CORNER_MARKINGS

public static final int INVALID_CORNER_MARKINGS
See Also:
Constant Field Values

INVALID_CORNER_PARITY

public static final int INVALID_CORNER_PARITY
See Also:
Constant Field Values

INVALID_EDGE_MARKINGS

public static final int INVALID_EDGE_MARKINGS
See Also:
Constant Field Values

INVALID_EDGE_PARITY

public static final int INVALID_EDGE_PARITY
See Also:
Constant Field Values

INVALID_TOTAL_PARITY

public static final int INVALID_TOTAL_PARITY
See Also:
Constant Field Values

NUMBER_OF_ERRORS

public static final int NUMBER_OF_ERRORS
See Also:
Constant Field Values
Constructor Detail

FaceletCube

public FaceletCube()
Default constructor.

Method Detail

setFaceMarkings

public void setFaceMarkings(int face,
                            char[] markings)
Set the cube markings for a given face.


validate

public int validate(Cube cube)
Validate markings, permutation, and parity.


faceNameToOffset

public int faceNameToOffset(char faceName)
Convert face name to enumeration offset.

Returns:
offset or -1 if the face name is invalid.

getErrorText

public java.lang.String getErrorText(int error)
Return the text associated with an error return code.


dump

public void dump()
Dump cube state.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

(c) Werner Randelshofer.
All rights reserved.