|
CubeTwister 2.0alpha142 2012-02-11 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
ch.randelshofer.rubik.parser.Node
ch.randelshofer.rubik.parser.MoveNode
public class MoveNode
A MoveNode holds one rotation of one or multiple layers in a specific direction by a specific angle. The side effect of a MoveNode on a Cube is the concatenation of all permutation cycles caused by the rotation.
| Field Summary |
|---|
| Fields inherited from class ch.randelshofer.rubik.parser.Node |
|---|
endpos, layerCount, startpos, symbol |
| Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
|---|
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
| Constructor Summary | |
|---|---|
MoveNode(int layerCount)
Creates new MoveNode |
|
MoveNode(int layerCount,
int axis,
int layerMask,
int angle,
int startpos,
int endpos)
Creates new MoveNode |
|
MoveNode(int layerCount,
Move t)
|
|
| Method Summary | |
|---|---|
void |
applyTo(Cube cube,
boolean inverse)
Applies the symbol represented by this node to the cube. |
boolean |
equals(java.lang.Object o)
|
int |
getAngle()
|
int |
getAxis()
|
int |
getBlockTurnCount()
Gets the block turn countTurned of the subtree starting at this node. |
int |
getFaceTurnCount()
Gets the face turn countTurned of the subtree starting at this node. |
int |
getLayerCount()
|
int |
getLayerMask()
|
int |
getLayerTurnCount()
Gets the layer turn countTurned of the subtree starting at this node. |
int |
getQuarterTurnCount()
Gets the quarter turn countTurned of the subtree starting at this node. |
int |
hashCode()
|
void |
inverse()
Inverses the node. |
boolean |
isRotation()
|
void |
reflect()
Reflects the node. |
java.util.Enumeration |
resolvedEnumeration(boolean isInverse)
Enumerate this symbol and all of its children. |
void |
setAngle(int newValue)
|
void |
setAxis(int newValue)
|
void |
setLayerCount(int newValue)
|
void |
setLayerMask(int newValue)
|
void |
setTo(MoveNode that)
|
java.util.List |
toResolvedList()
|
java.lang.String |
toString()
Returns a string representation of this node. |
void |
transform(int axis,
int layerMask,
int angle)
Transformes the node by the given ScriptParser.symbol constant. |
void |
transform(MoveNode move,
boolean inverse)
|
void |
writeTokens(java.io.PrintWriter w,
Notation notation,
java.util.Map<java.lang.String,MacroNode> macroMap)
Returns a string representation of this node using the specified notation. |
| Methods inherited from class ch.randelshofer.rubik.parser.Node |
|---|
cloneSubtree, dumpTree, enumerateChildrenReversed, getChildAt, getChildren, getEndPosition, getStartPosition, getSymbol, overwritePositions, setEndPosition, setStartPosition, toString, toString, transformOrientation |
| Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
|---|
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MoveNode(int layerCount)
public MoveNode(int layerCount,
Move t)
public MoveNode(int layerCount,
int axis,
int layerMask,
int angle,
int startpos,
int endpos)
| Method Detail |
|---|
public void applyTo(Cube cube,
boolean inverse)
Node
applyTo in class Nodecube - A cube to be transformed by this symbol.inverse - If true, the transform will be done in inverse order.public int getAxis()
public int getLayerMask()
public int getAngle()
public void setAxis(int newValue)
public void setLayerMask(int newValue)
public void setAngle(int newValue)
public int getLayerCount()
public void setLayerCount(int newValue)
public int getLayerTurnCount()
getLayerTurnCount in class Nodepublic int getBlockTurnCount()
getBlockTurnCount in class Nodepublic int getFaceTurnCount()
getFaceTurnCount in class Nodepublic int getQuarterTurnCount()
getQuarterTurnCount in class Nodepublic java.util.Enumeration resolvedEnumeration(boolean isInverse)
resolvedEnumeration in class NodeisInverse - Set to true if you wish to get an
inverted enumeration.
public void transform(int axis,
int layerMask,
int angle)
transform in class Node
public void transform(MoveNode move,
boolean inverse)
transform in class Nodepublic void inverse()
inverse in class Nodepublic void reflect()
reflect in class Nodepublic void setTo(MoveNode that)
public boolean isRotation()
public java.lang.String toString()
Node
toString in class Node
public void writeTokens(java.io.PrintWriter w,
Notation notation,
java.util.Map<java.lang.String,MacroNode> macroMap)
throws java.io.IOException
writeTokens in class Nodew - This is where the tokens are written to.notation - The notation which provides the tokens.macroMap - Local macros which are preserved by the translation.
java.io.IOExceptionpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.util.List toResolvedList()
toResolvedList in class Node
|
(c) Werner Randelshofer. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||