|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectiterator.pnodePQ
Implements a sorted binary tree.
abstract methods enq
and deq
are used to add
or remove elements from the tree.
Constructor Summary | |
pnodePQ()
class constructor, set count to 0 . |
Method Summary | |
abstract pnode |
deq()
removes the minimum (Ascending) or maximum (Descending) element from the tree. |
boolean |
empty()
tests whether the tree is empty |
abstract void |
enq(pnode item)
insert an element in the tree in the correct order. |
int |
length()
returns the number of elements in the tree. |
int |
pnodeCMP(pnode a,
pnode b)
compares two elements. |
boolean |
pnodeEQ(pnode a,
pnode b)
tests whether the two elements are equal. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public pnodePQ()
count
to 0
.
Method Detail |
public int length()
public boolean empty()
public abstract void enq(pnode item) throws java.io.IOException, UnknowAttrType, TupleUtilsException
item
- the element to be inserted
java.io.IOException
- from lower layers
UnknowAttrType
- attrSymbol
or
attrNull
encountered
TupleUtilsException
- error in tuple compare routinespublic abstract pnode deq()
public int pnodeCMP(pnode a, pnode b) throws java.io.IOException, UnknowAttrType, TupleUtilsException
a
- one of the element for comparisonb
- the other element for comparison
0
if the two are equal,
1
if a
is greater,
-1
if b
is greater
java.io.IOException
- from lower layers
UnknowAttrType
- attrSymbol
or
attrNull
encountered
TupleUtilsException
- error in tuple compare routinespublic boolean pnodeEQ(pnode a, pnode b) throws java.io.IOException, UnknowAttrType, TupleUtilsException
a
- one of the element for comparisonb
- the other element for comparison
true
if a == b
,
false
otherwise
java.io.IOException
- from lower layers
UnknowAttrType
- attrSymbol
or
attrNull
encountered
TupleUtilsException
- error in tuple compare routines
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |