org.jwarp.util.recycle
Class LimitedContainer

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

public class LimitedContainer
extends java.lang.Object
implements IRecycleBin

This class wraps around a container to limit its capacity.

Author:
Anatole Tresch

Constructor Summary
LimitedContainer(IRecycleBin container, int capacity)
          Creates a new limited 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()
          Get the current size of the container.
 void recycle(IRecyclable object)
          Recicle an object
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LimitedContainer

public LimitedContainer(IRecycleBin container,
                        int capacity)
Creates a new limited container
Parameters:
container - The basic recycle bin
capacity - The capacity
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
Returns:
the basic recycle bin container.

recycle

public void recycle(IRecyclable object)
Recicle an object
Specified by:
recycle in interface IRecycleBin
Parameters:
object - The objet to be recycled

getSize

public int getSize()
Get the current size of the container.
Specified by:
getSize in interface IRecycleBin
Returns:
The size

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

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