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.SerializableA 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 voidclear()Clears this stack.java.lang.Objectfirst()Returns the first element of the stack.booleanisEmpty()Returnstrueif the stack is empty.java.lang.Objectlast()java.lang.Objectpop()Pops from this stack.voidpush(java.lang.Object obj)Push into this stack.voidremove(java.lang.Object o)intsize()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()
Returnstrueif the stack is empty.
-
size
public int size()
Returns the number of elements in the stack.
-
-