org.apache.java.recycle
Class Container

java.lang.Object
  |
  +--org.apache.java.recycle.Container

public class Container
extends java.lang.Object
implements RecycleBin

This class implements the simplest recycle bin wrapping around a Stack implementation. (this should be rewritten to use collections when they are available)

Version:
$Revision: 1.3 $ $Date: 1999/06/24 00:50:49 $

Field Summary
private  java.util.Stack container
           
 
Constructor Summary
Container()
           
 
Method Summary
 Recyclable getRecyclable()
          This method is called to obtain a recyclable object from this recycle bin.
 int getSize()
          This method returns the actual number of recyclable objects contained in this recycle bin.
 void recycle(Recyclable object)
          This method is called to recycle a recyclable object into this container.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

container

private java.util.Stack container
Constructor Detail

Container

public Container()
Method Detail

getRecyclable

public Recyclable getRecyclable()
Description copied from interface: RecycleBin
This method is called to obtain a recyclable object from this recycle bin.
Specified by:
getRecyclable in interface RecycleBin
Tags copied from interface: RecycleBin
Throws:
RecycleBinIsEmpty - when recycle bin is empty.

recycle

public void recycle(Recyclable object)
Description copied from interface: RecycleBin
This method is called to recycle a recyclable object into this container. The clean() method is guaranteed to be called by the RecycleBin implementation before the object is stored.
Specified by:
recycle in interface RecycleBin
Tags copied from interface: RecycleBin
Throws:
ObjectWasDestroyed - when object is destroied.

getSize

public int getSize()
Description copied from interface: RecycleBin
This method returns the actual number of recyclable objects contained in this recycle bin.
Specified by:
getSize in interface RecycleBin