Package org.apache.mina.util
Class Stack
- java.lang.Object
-
- org.apache.mina.util.Stack
-
- All Implemented Interfaces:
java.io.Serializable
public class Stack extends java.lang.Object implements java.io.Serializable
A unbounded stack.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Stack()
Construct a new, empty stack.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears this stack.java.lang.Object
first()
Returns the first element of the stack.boolean
isEmpty()
Returnstrue
if the stack is empty.java.lang.Object
last()
java.lang.Object
pop()
Pops from this stack.void
push(java.lang.Object obj)
Push into this stack.void
remove(java.lang.Object o)
int
size()
Returns the number of elements in the stack.
-
-
-
Method Detail
-
clear
public void clear()
Clears this stack.
-
pop
public java.lang.Object pop()
Pops from this stack.- Returns:
null
, if this stack is empty or the element is reallynull
.
-
push
public void push(java.lang.Object obj)
Push into this stack.
-
remove
public void remove(java.lang.Object o)
-
first
public java.lang.Object first()
Returns the first element of the stack.- Returns:
null
, if the stack is empty, or the element is reallynull
.
-
last
public java.lang.Object last()
-
isEmpty
public boolean isEmpty()
Returnstrue
if the stack is empty.
-
size
public int size()
Returns the number of elements in the stack.
-
-