|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmauda.plugin.fibheap.FibNode
public class FibNode
Describes a node in a Fibonacci heap. On the logical side, each node has references to its parent, its left and right sibling, and one of its children. Thus, it is possible to use this node for trees with variable node rank, using the 'child-sibling' representation of trees. In addition, there are two ints reprenting the key and the rank (= number of children) of this node. A boolean indicates whether this node has lost one of its children since it (=this node) was last made a child of another node. Physically, a node is represented by a FibNodeObj and by a LineObj connecting it to its parent node. The physical CompObj representing a node includes the whole subtree rooted in this node. Thus, moving one FibNode will move the subtree along.
| Field Summary | |
|---|---|
static int |
CENTER
|
static int |
LEFT
|
| Constructor Summary | |
|---|---|
FibNode(int key)
Creates a new node with the specified key. |
|
| Method Summary | |
|---|---|
void |
addChild(FibNode newChild)
Links another node N to this one. |
void |
addPointer(jedas.LineObj item)
Adds the minimum pointer object to this node. |
void |
appear()
Node will appear in a smooth animation. |
java.lang.Object |
clone()
|
java.lang.Object |
copy()
|
void |
cut(FibNode target)
Cuts this node off its parent and joins with target |
void |
delete()
Deletes this node from the root list. |
void |
disappear()
Node will disappear in a smooth animation. |
void |
focus()
Sets the focus of attention to this node. |
jedas.DPair |
getAbsPos(jedas.CompObj mainco)
Returns the absolute position of this node in the FibHeap object. |
FibNode |
getChildNode()
|
boolean |
getColorMode()
|
int |
getDepth()
|
boolean |
getHighlight()
|
int |
getKey()
|
FibNode |
getLeftSibling()
|
FibNode |
getParentNode()
Returns the (logical) parent FibNode of this node. |
int |
getRank()
|
FibNode |
getRightSibling()
|
FibNode |
getRoot()
|
jedas.DPair |
getRootPos()
|
FibNode |
getSibling()
Used for child-sibling format of trees. |
int |
getTreeDepth()
|
int |
getTreeSize()
|
int |
getTreeWidth()
|
boolean |
hasChildren()
|
boolean |
isLeftOf(FibNode other)
|
boolean |
isMarked()
|
boolean |
isRoot()
|
void |
join(FibNode other,
boolean spaceNeeded)
Joins another node list to the sibling list of this one. |
void |
makeRoomFor(FibNode inserted)
Makes room for another subtree to be inserted to the right of this node |
void |
mark()
Marks this node. |
static void |
setColorMode(boolean b)
Sets the 'key color' feature of this class. |
void |
setHighlight(boolean on)
Highlights this node with the current highlight color. |
static void |
setHighlightColor(java.awt.Color color)
Sets the highlight color of FibNodes. |
void |
setKey(int k)
Sets the key of this node to the specified value. |
void |
unmark()
Un-marks (removes mark from) this node. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CENTER
public static final int LEFT
| Constructor Detail |
|---|
public FibNode(int key)
key - the key for this node| Method Detail |
|---|
public FibNode getParentNode()
public FibNode getChildNode()
public FibNode getSibling()
public FibNode getRightSibling()
public FibNode getLeftSibling()
public int getRank()
public int getKey()
public void setKey(int k)
k - the new keypublic boolean getColorMode()
public static void setColorMode(boolean b)
b - TRUE iff color is to reflect the key valuepublic boolean isRoot()
public boolean hasChildren()
public boolean isMarked()
public void mark()
public void unmark()
public void focus()
public void setHighlight(boolean on)
on - highlight status.public boolean getHighlight()
public static void setHighlightColor(java.awt.Color color)
color - the desired highlight colorpublic void appear()
public void disappear()
public void addChild(FibNode newChild)
newChild - the node to be addedpublic void cut(FibNode target)
target - the node where this one is attached
public void join(FibNode other,
boolean spaceNeeded)
other - node of the list to joinspaceNeeded - true if additional space is neededpublic void delete()
public jedas.DPair getRootPos()
public void addPointer(jedas.LineObj item)
item - the arrow to be addedpublic int getTreeWidth()
public int getTreeDepth()
public int getTreeSize()
public int getDepth()
public FibNode getRoot()
public void makeRoomFor(FibNode inserted)
inserted - the node to be insertedpublic jedas.DPair getAbsPos(jedas.CompObj mainco)
public boolean isLeftOf(FibNode other)
other - the node to compare
public java.lang.Object clone()
clone in class java.lang.Objectpublic java.lang.Object copy()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||