Package io.ebeaninternal.server.util
Class ArrayStack<E>
- java.lang.Object
-
- io.ebeaninternal.server.util.ArrayStack<E>
-
- Direct Known Subclasses:
PathStack
public class ArrayStack<E> extends Object
Stack based on ArrayList.- Author:
- rbygrave
-
-
Constructor Summary
Constructors Constructor Description ArrayStack()
Creates an empty Stack.ArrayStack(int size)
Creates an empty Stack with an initial size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(E o)
boolean
isEmpty()
Tests if this stack is empty.E
peek()
Returns the object at the top of this stack without removing it.E
peekWithNull()
Returns the object at the top of this stack without removing it.E
pop()
Removes the object at the top of this stack and returns that object as the value of this function.void
push(E item)
Pushes an item onto the top of this stack.int
size()
String
toString()
-
-
-
Constructor Detail
-
ArrayStack
public ArrayStack(int size)
Creates an empty Stack with an initial size.
-
ArrayStack
public ArrayStack()
Creates an empty Stack.
-
-
Method Detail
-
pop
public E pop()
Removes the object at the top of this stack and returns that object as the value of this function.
-
peekWithNull
public E peekWithNull()
Returns the object at the top of this stack without removing it. If the stack is empty this returns null.
-
isEmpty
public boolean isEmpty()
Tests if this stack is empty.
-
size
public int size()
-
-