org.jwarp.util.recycle
Class Container

java.lang.Object
  |
  +--org.jwarp.util.recycle.Container
All Implemented Interfaces:
IRecycleBin

public class Container
extends java.lang.Object
implements IRecycleBin

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

Author:
Anatole Tresch

Constructor Summary
Container()
           
 
Method Summary
 java.util.Iterator getAllRecyclables()
          Returns all recyclable objects given the id
 IRecyclable 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(IRecyclable 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, toString, wait, wait, wait
 

Constructor Detail

Container

public Container()
Method Detail

getRecyclable

public IRecyclable getRecyclable()
Description copied from interface: IRecycleBin
This method is called to obtain a recyclable object from this recycle bin.
Specified by:
getRecyclable in interface IRecycleBin
Following copied from interface: org.jwarp.util.recycle.IRecycleBin
Throws:
RecycleBinIsEmpty - when recycle bin is empty.

recycle

public void recycle(IRecyclable object)
Description copied from interface: IRecycleBin
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 IRecycleBin
Following copied from interface: org.jwarp.util.recycle.IRecycleBin
Throws:
ObjectWasDestroyed - when object is destroied.

getAllRecyclables

public java.util.Iterator getAllRecyclables()
Returns all recyclable objects given the id
Specified by:
getAllRecyclables in interface IRecycleBin
Returns:
all recyclables contained within the object

getSize

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

©   O R C A   S y s t e m s