|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<E> java.util.ArrayList<T> org.apache.wicket.util.collections.ArrayListStack<T>
T
- public class ArrayListStack<T>
A faster, smaller stack implementation. ArrayListStack is final and unsynchronized (the JDK's methods are synchronized). In addition you can set the initial capacity if you want via the ArrayListStack(int) constructor.
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
ArrayListStack()
Construct. |
|
ArrayListStack(java.util.Collection<T> collection)
Construct. |
|
ArrayListStack(int initialCapacity)
Construct. |
Method Summary | |
---|---|
boolean |
empty()
Tests if this stack is empty. |
T |
peek()
Looks at the object at the top of this stack without removing it. |
T |
pop()
Removes the object at the top of this stack and returns that object. |
void |
push(T item)
Pushes an item onto the top of this stack. |
int |
search(T o)
Returns the 1-based position where an object is on this stack. |
Methods inherited from class java.util.ArrayList |
---|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
Constructor Detail |
---|
public ArrayListStack(int initialCapacity)
initialCapacity
- Initial capacity of the stackpublic ArrayListStack()
public ArrayListStack(java.util.Collection<T> collection)
collection
- The collection to addMethod Detail |
---|
public final void push(T item)
item
- the item to be pushed onto this stack.public final T pop()
java.util.EmptyStackException
- If this stack is empty.public final T peek()
java.util.EmptyStackException
- If this stack is empty.public final boolean empty()
true
if and only if this stack contains no items; false
otherwise.public final int search(T o)
o
- the desired object.
-1
indicates that the object is not on the stack.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |