protected static class BTree.Stack extends Object
Node
s 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 and Description |
---|
BTree.Stack()
Stack with initial capacity of 10.
|
BTree.Stack(int capacity) |
Modifier and Type | Method and Description |
---|---|
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.
|
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)
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()
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.