CubeTwister 2.0alpha142 2012-02-11

ch.randelshofer.rubik
Class RubiksStickerCube

java.lang.Object
  extended by ch.randelshofer.rubik.RubiksStickerCube

public class RubiksStickerCube
extends java.lang.Object

The RubiksStickerCube represents a Rubik's Cube by the markings of its 54 individual stickers. The RubiksStickerCube can then be asked to validate the cube to determine if it is in a legal, and thus solvable, configuration.

The stickers are expressed by the values 0 through 6 representing the six faces of the cube: front, right, down, back, left, up. The value -1 is used to express an unknown sticker value. The RubiksStickerCube can fill in values for unknown stickers.

This class has been derived from facecube.cpp and facecube.h from the 'Kociemba Cube Solver 1.0' (KCube) (c) Greg Schmidt.

Version:
1.0 January 14, 2007 Created.
Author:
Werner Randelshofer

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
RubiksStickerCube()
          Default constructor.
 
Method Summary
 void dump()
          Dump cube state.
 java.lang.String getErrorText(int error)
          Return the text associated with an error return code.
 void setStickers(int[] stickers)
           
 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

F

public static final int F
See Also:
Constant Field Values

R

public static final int R
See Also:
Constant Field Values

D

public static final int D
See Also:
Constant Field Values

B

public static final int B
See Also:
Constant Field Values

L

public static final int L
See Also:
Constant Field Values

U

public static final int U
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

RubiksStickerCube

public RubiksStickerCube()
Default constructor.

Method Detail

setStickers

public void setStickers(int[] stickers)

validate

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


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.