|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
java.util.AbstractCollection
oracle.javatools.xml.esax.spi.Stack
public final class Stack
Convenient implementation of a Last In First Out (LIFO) stack. This implementation differs from the one in java.util.Stack in two ways. First, like most of the collection APIs, it is unsynchronized for better performance when synchronization is not required. If a synchronized stack is required, you can use the Collections.synchronizedCollection()
method to retrieve a synchronized instance. Second, it does not expose its internal implementation via its superclass. Extending AbstractCollection instead of Vector allows objects of this class to be used interchangably with other collection framework classes without exposing its internal implementation.
Constructor Summary | |
---|---|
Stack() Construct a stack with no additional arguments. |
|
Stack(java.util.Collection c) Construct a stack initialized to contain all the items in the specified collection. |
Method Summary | |
---|---|
boolean |
add(java.lang.Object o) |
void |
clear() |
boolean |
isEmpty() Gets whether there are more elements on the stack. |
java.util.Iterator |
iterator() Gets an iterator for elements on the stack. |
java.lang.Object |
peek() Obtains the top element on the stack without removing it. |
java.lang.Object |
pop() Pops the top element off the stack and returns it. |
boolean |
push(java.lang.Object o) Pushes an element onto the stack. |
void |
replace(java.lang.Object o) Replaces the top of the stack with the specified object. |
java.util.Iterator |
reverseIterator() Gets an iterator for elements on the stack. |
int |
size() |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Collection |
---|
equals, hashCode |
Constructor Detail |
---|
public Stack()
public Stack(java.util.Collection c)
c
- a collection of items to push onto the stack.Method Detail |
---|
public boolean isEmpty()
isEmpty
in interface java.util.Collection
isEmpty
in class java.util.AbstractCollection
public boolean push(java.lang.Object o)
o
- an element to push onto the stackpublic java.lang.Object peek()
public void replace(java.lang.Object o)
o
- the object to replace the top of the stack with.public java.lang.Object pop()
public java.util.Iterator reverseIterator()
public boolean add(java.lang.Object o)
add
in interface java.util.Collection
add
in class java.util.AbstractCollection
public void clear()
clear
in interface java.util.Collection
clear
in class java.util.AbstractCollection
public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in class java.util.AbstractCollection
public int size()
size
in interface java.util.Collection
size
in class java.util.AbstractCollection
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |