javautils.dispensers
Class AbstractDispenser

java.lang.Object
  |
  +--javautils.dispensers.AbstractDispenser
All Implemented Interfaces:
Dispenser
Direct Known Subclasses:
DispenserWithoutDuplicatesDecorator, Queue, Stack

public abstract class AbstractDispenser
extends java.lang.Object
implements Dispenser

Implements all the Dispenser-interface methods except size(), push(Object) and pop().


Constructor Summary
AbstractDispenser()
           
 
Method Summary
 boolean isEmpty()
           return size() == 0;
 boolean notEmpty()
           return !isEmpty();
 void pushAll(java.util.Collection c)
          Adds all elements in the collection into the dispenser in the order that the iterator of the collection returns them.
 void pushAll(java.util.Iterator i)
          Adds all elements returned by the iterator into the dispenser in the order that the iterator returns them.
 void pushAllRight(java.util.List l)
          Adds all elements in the list into the dispenser starting from the last element in the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javautils.dispensers.Dispenser
pop, push, size
 

Constructor Detail

AbstractDispenser

public AbstractDispenser()
Method Detail

isEmpty

public boolean isEmpty()
Description copied from interface: Dispenser
 return size() == 0;
 

Specified by:
isEmpty in interface Dispenser

notEmpty

public boolean notEmpty()
Description copied from interface: Dispenser
 return !isEmpty();
 

Specified by:
notEmpty in interface Dispenser

pushAll

public void pushAll(java.util.Collection c)
Description copied from interface: Dispenser

Adds all elements in the collection into the dispenser in the order that the iterator of the collection returns them.

Specified by:
pushAll in interface Dispenser

pushAll

public void pushAll(java.util.Iterator i)
Description copied from interface: Dispenser

Adds all elements returned by the iterator into the dispenser in the order that the iterator returns them.

Specified by:
pushAll in interface Dispenser

pushAllRight

public void pushAllRight(java.util.List l)
Description copied from interface: Dispenser

Adds all elements in the list into the dispenser starting from the last element in the list.

Specified by:
pushAllRight in interface Dispenser