|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.btree.BTree.Stack
protected static class BTree.Stack
A simple stack based on an array used to maintain hard references for the
parent Nodes in the BTree.LeafCursor. This class is optimized
for light-weight push/pop and copy operations. In particular, the copy
operation is used to support atomic state changes for
BTree.LeafCursor.prior() and BTree.LeafCursor.next().
| Constructor Summary | |
|---|---|
BTree.Stack()
Stack with initial capacity of 10. |
|
BTree.Stack(int capacity)
|
|
| Method Summary | |
|---|---|
int |
capacity()
The size of the backing array. |
void |
clear()
Clear the stack. |
void |
copyFrom(BTree.Stack src)
Replace the state of this BTree.Stack with the state of the source
BTree.Stack. |
Node |
peek()
Return the element on the top of the stack. |
Node |
pop()
Pop an element off of the stack. |
void |
push(Node item)
Push an element onto the stack. |
int |
size()
The #of elements on the stack. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BTree.Stack()
Note: The initial capacity is a relatively small since a B+Tree of depth 10 will have a very large number of tuples even with a small branching factor.
public BTree.Stack(int capacity)
| Method Detail |
|---|
public final int capacity()
public final int size()
public void push(Node item)
item - The element (required).public Node pop()
IllegalStateException - if the stack is empty.public Node peek()
IllegalStateException - if the stack is empty.public void copyFrom(BTree.Stack src)
BTree.Stack with the state of the source
BTree.Stack.
src - The source BTree.Stack.public void clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||