E - The type of element managed by this collection.public class Stack<E> extends java.lang.Object implements LIFO<E>
| Constructor and Description |
|---|
Stack()
This constructor creates a new empty stack.
|
| Modifier and Type | Method and Description |
|---|---|
Iterator<E> |
createDefaultIterator()
This method creates a new default iterator for the collection.
|
int |
getNumberOfElements() |
E |
getTopElement()
This method returns a reference to the top element on the stack without
removing it from the stack.
|
boolean |
isEmpty() |
Iterator<E> |
iterator() |
E |
popTopElement()
This method pops the top element off of the stack.
|
void |
pushTopElement(E element)
This method pushes a new element onto the top of the stack.
|
void |
removeAllElements()
This method removes all elements from the collection.
|
void |
toArray(E[] array) |
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String indentation) |
public final boolean isEmpty()
isEmpty in interface Sequential<E>public final int getNumberOfElements()
getNumberOfElements in interface Sequential<E>public Iterator<E> createDefaultIterator()
IteratablecreateDefaultIterator in interface Iteratable<E>public final void toArray(E[] array)
toArray in interface Sequential<E>public final void pushTopElement(E element)
LIFOpushTopElement in interface LIFO<E>element - The new element to be added.public final E popTopElement()
LIFOpopTopElement in interface LIFO<E>public final void removeAllElements()
IteratableremoveAllElements in interface Iteratable<E>public final E getTopElement()
LIFOgetTopElement in interface LIFO<E>public final Iterator<E> iterator()
iterator in interface Sequential<E>iterator in interface java.lang.Iterable<E>public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014 Crater Dog Technologies(TM). All rights reserved.