|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--BSTTree
|
+--MovingBSTTree
|
+--MovingRedBlackTree
The class provides the base structure for a RedBlackTree that can move to a new position
in the Binary Search Tree. For that reason, it extends the BSTTree class.
| Field Summary | |
protected RedBlackTree |
node
Node that the moving node can follow or imitates. |
| Fields inherited from class MovingBSTTree |
DOWN_LEFT, DOWN_RIGHT, FOLLOW_NODE, FOLLOW_PARENT_LEFT, FOLLOW_PARENT_RIGHT, NULL_MOVEMENT, UP_LEFT, UP_RIGHT |
| Fields inherited from class BSTTree |
ANIMATING_BST_TREE_TYPE, BST_TREE_TYPE, DRAWING_BST_TREE_TYPE |
| Constructor Summary | |
MovingRedBlackTree(BSTTree node)
Constructor without a parent passed, indicating that FOLLOW_PARENT_LEFT and FOLLOW_PARENT_RIGHT
are not accesible unless a parent is set. |
|
MovingRedBlackTree(BSTTree node,
MovingBSTTree movingParent)
Constructor with a parent passed. |
|
| Method Summary | |
protected void |
drawLeftLink(java.awt.Graphics2D g2,
double sectionHeight,
java.awt.geom.AffineTransform a,
double drawingLevel,
double powerLevel)
Draws just the left link according to the NodeSettings currently set. |
protected void |
drawRightLink(java.awt.Graphics2D g2,
double sectionHeight,
java.awt.geom.AffineTransform a,
double drawingLevel,
double powerLevel)
Draws just the right link according to the NodeSettings currently set. |
void |
setNode(RedBlackTree node)
Sets the node that the MovingBSTTree imitates. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected RedBlackTree node
| Constructor Detail |
public MovingRedBlackTree(BSTTree node)
FOLLOW_PARENT_LEFT and FOLLOW_PARENT_RIGHT
are not accesible unless a parent is set. The MovingBSTTree constructs as an empty ANIMATING_BST_TREE_TYPEM
, setting the value and key as the value and key of the given node. The MovingBSTTree imitates
the BSTTree node given but does not affect the node.
node - BSTTree node that the MovingBSTTree imitates.
public MovingRedBlackTree(BSTTree node,
MovingBSTTree movingParent)
ANIMATING_BST_TREE_TYPEM
, setting the value and key as the value and key of the given node. The MovingBSTTree imitates
the BSTTree node given but does not affect the node.
node - BSTTree node that the MovingBSTTree imitates.movingParent - MovingBSTTree that is the parent of the current node, allowing the follow parent move positions.| Method Detail |
public void setNode(RedBlackTree node)
MovingBSTTree imitates. The key and value are set according
to the given node.
node - BSTTree node that the MovingBSTTree imitates.
protected void drawRightLink(java.awt.Graphics2D g2,
double sectionHeight,
java.awt.geom.AffineTransform a,
double drawingLevel,
double powerLevel)
g2 - graphics to which the node and links are drawn.sectionHeight - the height of the tree' section, to draw the correct lengths for the links.a - transfrom to draw the node and links.drawingLevel - the level in the tree to which the node is currently being drawn.powerLevel - the power to which the links extend, depending on how many links are present.
protected void drawLeftLink(java.awt.Graphics2D g2,
double sectionHeight,
java.awt.geom.AffineTransform a,
double drawingLevel,
double powerLevel)
g2 - graphics to which the node and links are drawn.sectionHeight - the height of the tree' section, to draw the correct lengths for the links.a - transfrom to draw the node and links.drawingLevel - the level in the tree to which the node is currently being drawn.powerLevel - the power to which the links extend, depending on how many links are present.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||