public class Stack extends Vector implements Rollbackable
$CHECKPOINT, $RECORD$$CHECKPOINT
Constructor and Description |
---|
Stack()
This constructor creates a new Stack, initially empty
|
Modifier and Type | Method and Description |
---|---|
void |
$COMMIT(long timestamp)
Commit changes up to the given timestamp, but not including changes
made at timestamp and afterward.
|
void |
$RESTORE(long timestamp,
boolean trim)
Restore a previous state to all the private fields of this rollbackable
object.
|
boolean |
empty()
Tests if the stack is empty.
|
java.lang.Object |
peek()
Returns the top Object on the stack without removing it.
|
java.lang.Object |
pop()
Pops an item from the stack and returns it.
|
java.lang.Object |
push(java.lang.Object item)
Pushes an Object onto the top of the stack.
|
int |
search(java.lang.Object o)
Returns the position of an Object on the stack, with the top
most Object being at position 1, and each Object deeper in the
stack at depth + 1.
|
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, getCapacityIncrement, getElementCount, getElementData, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setCapacityIncrement, setElementAt, setElementCount, setElementData, setSize, size, subList, toArray, toArray, toString, trimToSize
getModCount, iterator, listIterator, listIterator, setModCount
$GET$CHECKPOINT, $SET$CHECKPOINT
finalize, getClass, notify, notifyAll, wait, wait, wait
$GET$CHECKPOINT, $SET$CHECKPOINT
$GET$CHECKPOINT, $SET$CHECKPOINT, iterator, listIterator, listIterator
public java.lang.Object push(java.lang.Object item)
item
- the Object to push onto the stackVector.addElement(Object)
public java.lang.Object pop()
java.util.EmptyStackException
- if the stack is emptypublic java.lang.Object peek()
java.util.EmptyStackException
- if the stack is emptypublic boolean empty()
public int search(java.lang.Object o)
o
- The object to search forpublic void $COMMIT(long timestamp)
Rollbackable
$COMMIT
in interface Rollbackable
$COMMIT
in interface Collection
$COMMIT
in interface List
$COMMIT
in class Vector
timestamp
- The timestamp.public void $RESTORE(long timestamp, boolean trim)
Rollbackable
$RESTORE
in interface Rollbackable
$RESTORE
in interface Collection
$RESTORE
in interface List
$RESTORE
in class Vector
timestamp
- The timestamp taken at the time when the previous
state was recorded.trim
- Whether to delete the records used for the rollback.Checkpoint.rollback(long, boolean)