|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.puppycrawl.tools.checkstyle.api.FastStack<E>
E
- The type to hold.public class FastStack<E>
Simple implementation of a LIFO Stack that can be used instead of
Vector
which is synchronized.
Constructor Summary | |
---|---|
FastStack()
|
Method Summary | ||
---|---|---|
void |
clear()
Clears the stack. |
|
boolean |
contains(E aElement)
Returns if the stack contains the specified element. |
|
boolean |
isEmpty()
Returns whether the stack is empty. |
|
Iterator<E> |
iterator()
Returns an iterator that goes from the oldest element to the newest. |
|
static
|
newInstance()
Factory method to create a new instance. |
|
E |
peek()
Returns the entry at the top of the stack without removing it. |
|
E |
peek(int aIndex)
Return the element at the specified index. |
|
E |
pop()
Returns the entry at the top of the stack by removing it. |
|
void |
push(E aElement)
Pushes the supplied element onto the stack. |
|
int |
size()
Returns the number of entries in the stack. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FastStack()
Method Detail |
---|
public void push(E aElement)
aElement
- the element to push onto the stack.public boolean isEmpty()
public int size()
public E peek()
IllegalStateException
- if the stack is empty.public E pop()
IllegalStateException
- if the stack is empty.public E peek(int aIndex)
aIndex
- the index to return
IllegalArgumentException
- if index out of rangepublic boolean contains(E aElement)
aElement
- the element to find
public void clear()
public Iterator<E> iterator()
iterator
in interface Iterable<E>
public static <T> FastStack<T> newInstance()
T
- the type of elements to hold in the stack.
FastStack
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |