|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry5.ioc.util.Stack<E>
E
- the type of elements stored in the mappublic class Stack<E>
A simple, streamlined implementation of Stack
. The implementation is not threadsafe.
CollectionFactory.newStack()
Constructor Summary | |
---|---|
Stack()
Normal constructor supporting an initial size of 20. |
|
Stack(int initialSize)
|
Method Summary | |
---|---|
void |
clear()
Clears the stack, the same as popping off all elements. |
int |
getDepth()
Returns the number of items currently in the stack. |
Object[] |
getSnapshot()
Returns a snapshot of the current state of the stack as an array of objects. |
boolean |
isEmpty()
Returns true if the stack is empty. |
E |
peek()
Returns the top element of the stack without affecting the stack. |
E |
pop()
Pops the top element off the stack and returns it. |
void |
push(E item)
Pushes a new item onto the stack. |
String |
toString()
Describes the stack, listing the element in order of depth (top element first). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Stack()
public Stack(int initialSize)
initialSize
- the initial size of the internal array (which will be expanded as necessary). For best
efficiency, set this to the maximum depth of the stack.Method Detail |
---|
public boolean isEmpty()
public int getDepth()
public void clear()
public void push(E item)
public E pop()
IllegalStateException
- if the stack is emptypublic E peek()
IllegalStateException
- if the stack is emptypublic String toString()
toString
in class Object
public Object[] getSnapshot()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |