Constructor and Description |
---|
PQTreeNode(PQTreeNode<T> parent,
PQTree<T> tree) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(PQTreeNode<T> child)
This method adds child to this node.
|
void |
addChild(PQTreeNode<T> child,
boolean front)
This method adds child to this node to one of ends of child list.
|
void |
clearChildList()
This method clears child list.
|
java.util.Iterator<PQTreeNode<T>> |
getChildIterator()
This method return child list iterator.
|
java.util.LinkedList<PQTreeNode<T>> |
getChildList()
This method returns child list of this node.
|
int |
getLevel()
This method gets level value of this mode.
|
abstract PQTreeNode<T> |
getMaxMinSeq()
This method computes minimal and maximal sequence values from its
children and rotates to get child in such order that ones with minimal
sequence is in the beginning of child list.
|
int |
getMaxSeq()
This method returns maximal sequence value of this node.
|
int |
getMinSeq()
This method returns minimal sequence value of this node.
|
PQTreeNode<T> |
getParent()
This method returns parent of this method.
|
int |
getPertQChildrenCount()
This method returns number of pertinent q-node children.
|
java.lang.String |
getTestValue()
This method returns value that can be used for testing to
identify this node.
|
PQTree<T> |
getTree()
This method returns reference of owner tree.
|
abstract int |
getType()
This method returns type of this node.
|
abstract char |
getTypeChar()
This method returns different char for each type of node.
|
boolean |
isFull()
This node returns whether this node is marked as full.
|
boolean |
isPertinent()
This node returns whether this node is marked as pertinent.
|
boolean |
isVisited()
This method checks if this node is visited.
|
abstract PQTreeNode<T> |
process(boolean isRoot)
This method processes this node and makes all necessary transformations.
|
void |
removeChild(PQTreeNode<T> child)
This method removes child from this nodes child list.
|
void |
setEmpty()
This method sets this node as empty.
|
void |
setLevel(int index)
This method sets level value of this node.
|
void |
setMaxSeq(int newValue)
This method sets maximal sequence value.
|
void |
setMinSeq(int newValue)
This method sets minimal sequence value.
|
void |
setParent(PQTreeNode<T> newParent)
This method changes parent of this node.
|
void |
setParent(PQTreeNode<T> newParent,
boolean front)
This method changes parent of this node and adds it in child list in one of ends.
|
void |
setParent(PQTreeNode<T> newParent,
int index)
This method sets new parent of this node and removes this from old parent's child lists.
|
void |
setParent(PQTreeNode<T> newParent,
PQTreeNode<T> substitute)
This method changes parent of this node and adds it in child list in place of another node.
|
void |
setTree(PQTree<T> tree)
This method sets owner PQTree of this node.
|
void |
setVisited(boolean value)
This method sets new value of visited flag.
|
java.lang.String |
toString()
This method returns string that represents this node.
|
void |
update()
This method computes status of this node - full / pertinent / empty.
|
public PQTreeNode(PQTreeNode<T> parent, PQTree<T> tree)
public PQTreeNode<T> getParent()
null
.public void addChild(PQTreeNode<T> child)
child
- new child node.public void addChild(PQTreeNode<T> child, boolean front)
child
- new child node.front
- if true then will add in front of list else at the end.public void setParent(PQTreeNode<T> newParent, int index)
newParent
- new parent node.index
- place in child list of new parent where to put this node.public void setParent(PQTreeNode<T> newParent, PQTreeNode<T> substitute)
newParent
- new parent node.substitute
- place in which to put this node in new parent child list.public void setParent(PQTreeNode<T> newParent, boolean front)
newParent
- new parent node.front
- if true then add this node in front of child list otherwise at the end.public void setParent(PQTreeNode<T> newParent)
newParent
- new parent node.public void removeChild(PQTreeNode<T> child)
child
- to remove from child list.public void setEmpty()
public void update()
public boolean isFull()
public boolean isPertinent()
public int getPertQChildrenCount()
public java.util.Iterator<PQTreeNode<T>> getChildIterator()
public java.util.LinkedList<PQTreeNode<T>> getChildList()
public void clearChildList()
public abstract PQTreeNode<T> process(boolean isRoot)
isRoot
- boolean value whether this is pertinent tree root node.public abstract int getType()
PQTree.CNODE
,
PQTree.QNODE
,
PQTree.PNODE
.PQTree
public abstract char getTypeChar()
public java.lang.String getTestValue()
public java.lang.String toString()
toString
in class java.lang.Object
public void setVisited(boolean value)
value
- new value of visited flag.public boolean isVisited()
True
iff this node is visited,
False
otherwise.public void setMinSeq(int newValue)
newValue
- new value of minimal sequence.public void setMaxSeq(int newValue)
newValue
- new value of maximal sequence.public int getMinSeq()
public int getMaxSeq()
public void setLevel(int index)
index
- new level value.public int getLevel()
public PQTree<T> getTree()
public void setTree(PQTree<T> tree)
tree
- new owner tree.public abstract PQTreeNode<T> getMaxMinSeq()