javautils.dispensers
Class Stack

java.lang.Object
  |
  +--javautils.dispensers.AbstractDispenser
        |
        +--javautils.dispensers.Stack
All Implemented Interfaces:
Dispenser

public final class Stack
extends AbstractDispenser

LIFO stack.


Constructor Summary
Stack()
           
Stack(java.util.Collection c)
           
 
Method Summary
static Stack newAllRight(java.util.List l)
           
 java.lang.Object pop()
          Chooses the next element to be processed, removes it from the dispenser, and returns the element.
 void push(java.lang.Object o)
          Adds a new element into the dispenser.
 void set(int offset, java.lang.Object o)
           
 void set(java.lang.Object o)
           
 int size()
          Number of elements in the dispenser.
 java.lang.Object top()
           
 java.lang.Object top(int offset)
           
 
Methods inherited from class javautils.dispensers.AbstractDispenser
isEmpty, notEmpty, pushAll, pushAll, pushAllRight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Stack

public Stack()

Stack

public Stack(java.util.Collection c)
Method Detail

newAllRight

public static Stack newAllRight(java.util.List l)

size

public int size()
Description copied from interface: Dispenser

Number of elements in the dispenser.


push

public void push(java.lang.Object o)
Description copied from interface: Dispenser

Adds a new element into the dispenser.


pop

public java.lang.Object pop()
Description copied from interface: Dispenser

Chooses the next element to be processed, removes it from the dispenser, and returns the element.


top

public java.lang.Object top()

top

public java.lang.Object top(int offset)

set

public void set(java.lang.Object o)

set

public void set(int offset,
                java.lang.Object o)