org.apache.mina.util
Class Stack

java.lang.Object
  extended by org.apache.mina.util.Stack
All Implemented Interfaces:
Serializable

public class Stack
extends Object
implements Serializable

A unbounded stack.

Version:
$Rev: 332218 $, $Date: 2005-11-10 12:52:42 +0900 $
Author:
The Apache Directory Project (dev@directory.apache.org)
See Also:
Serialized Form

Constructor Summary
Stack()
          Construct a new, empty stack.
 
Method Summary
 void clear()
          Clears this stack.
 Object first()
          Returns the first element of the stack.
 boolean isEmpty()
          Returns true if the stack is empty.
 Object last()
           
 Object pop()
          Pops from this stack.
 void push(Object obj)
          Push into this stack.
 void remove(Object o)
           
 int size()
          Returns the number of elements in the stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Stack

public Stack()
Construct a new, empty stack.

Method Detail

clear

public void clear()
Clears this stack.


pop

public Object pop()
Pops from this stack.

Returns:
null, if this stack is empty or the element is really null.

push

public void push(Object obj)
Push into this stack.


remove

public void remove(Object o)

first

public Object first()
Returns the first element of the stack.

Returns:
null, if the stack is empty, or the element is really null.

last

public Object last()

isEmpty

public boolean isEmpty()
Returns true if the stack is empty.


size

public int size()
Returns the number of elements in the stack.



Copyright © 2004-2005 . All Rights Reserved.