|
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.SequenceNode
ch.randelshofer.rubik.parser.RotationNode
public class RotationNode
A RotationNode holds a rotator A and a single child B. The side effect of a rotation node to a Cube is A' B A.
| 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 | |
|---|---|
RotationNode(int layerCount)
|
|
RotationNode(int layerCount,
int startpos,
int endpos)
|
|
RotationNode(int layerCount,
Node rotator,
Node rotatee,
int startpos,
int endpos)
|
|
| Method Summary | |
|---|---|
void |
applyTo(Cube cube,
boolean inverse)
Applies the symbol represented by this node to the cube. |
Node |
cloneSubtree()
Returns a deep clone of the subtree starting at this node. |
int |
getBlockTurnCount()
Gets the block turn count of the subtree starting at this node. |
int |
getFaceTurnCount()
Gets the face turn count of the subtree starting at this node. |
int |
getLayerTurnCount()
Gets the layer turn count of the subtree starting at this node. |
int |
getQuarterTurnCount()
Gets the quarter turn count of the subtree starting at this node. |
Node |
getRotator()
|
void |
inverse()
Inverses the subtree starting at this node. |
void |
overwritePositions(int sp,
int ep)
Overwrite start and end positions of this node and the subtree starting at this node. |
void |
reflect()
Reflect the subtree starting at this node. |
java.util.Enumeration |
resolvedEnumeration(boolean inverse)
Enumerate this symbol and all of its children. |
void |
setRotator(Node newValue)
|
java.util.List |
toResolvedList()
|
void |
transform(int axis,
int layerMask,
int angle)
Transformes the subtree starting at this node by the given ScriptParser.symbol constant. |
void |
writeTokens(java.io.PrintWriter w,
Notation p,
java.util.Map<java.lang.String,MacroNode> macroMap)
Writes the token(s) represented by the subtree starting at this node. |
| Methods inherited from class ch.randelshofer.rubik.parser.SequenceNode |
|---|
toString |
| Methods inherited from class ch.randelshofer.rubik.parser.Node |
|---|
dumpTree, enumerateChildrenReversed, getChildAt, getChildren, getEndPosition, getStartPosition, getSymbol, setEndPosition, setStartPosition, toString, toString, transform, 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 |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RotationNode(int layerCount)
public RotationNode(int layerCount,
int startpos,
int endpos)
public RotationNode(int layerCount,
Node rotator,
Node rotatee,
int startpos,
int endpos)
| Method Detail |
|---|
public Node getRotator()
public void setRotator(Node newValue)
public void applyTo(Cube cube,
boolean inverse)
applyTo in class Nodecube - A cube to be transformed by this symbol.inverse - If true, the transform will be done in inverse order.
public void overwritePositions(int sp,
int ep)
overwritePositions in class Nodepublic void inverse()
inverse in class Nodepublic void reflect()
reflect in class Node
public void transform(int axis,
int layerMask,
int angle)
transform in class Nodepublic Node cloneSubtree()
cloneSubtree in class Nodepublic 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 inverse)
resolvedEnumeration in class Nodeinverse - Set to true if you wish to get an
inverted enumeration.
public void writeTokens(java.io.PrintWriter w,
Notation p,
java.util.Map<java.lang.String,MacroNode> macroMap)
throws java.io.IOException
Node
writeTokens in class Nodew - This is where the tokens are written to.p - The notation which provides the tokens.macroMap - Local macros which are preserved by the translation.
java.io.IOExceptionpublic 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 | ||||||||