Package org.apache.mina.util
Class ExpiringStack
java.lang.Object
org.apache.mina.util.ExpiringStack
- All Implemented Interfaces:
Serializable
A unbounded stack with expiration.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears this stack.void
expireBefore
(long time) first()
Returns the first element of the stack.boolean
isEmpty()
Returnstrue
if the stack is empty.last()
pop()
Pops from this stack.void
Push into this stack.void
int
size()
Returns the number of elements in the stack.
-
Constructor Details
-
ExpiringStack
public ExpiringStack()Construct a new, empty stack.
-
-
Method Details
-
clear
public void clear()Clears this stack. -
pop
Pops from this stack.- Returns:
null
, if this stack is empty or the element is reallynull
.
-
push
Push into this stack. -
remove
-
expireBefore
public void expireBefore(long time) -
first
Returns the first element of the stack.- Returns:
null
, if the stack is empty, or the element is reallynull
.
-
last
-
isEmpty
public boolean isEmpty()Returnstrue
if the stack is empty. -
size
public int size()Returns the number of elements in the stack.
-