org.apache.xpath.axes
Class IteratorPool

java.lang.Object
  extended byorg.apache.xpath.axes.IteratorPool
All Implemented Interfaces:
Serializable

public class IteratorPool
extends Object
implements Serializable

Pool of object of a given type to pick from to help memory usage

See Also:
Serialized Form

Field Summary
private  Vector m_freeStack
          Vector of given objects this points to.
private  DTMIterator m_orig
          Type of objects in this pool.
 
Constructor Summary
IteratorPool(DTMIterator original)
          Constructor IteratorPool
 
Method Summary
 void freeInstance(DTMIterator obj)
          Add an instance of the given object to the pool
 DTMIterator getInstance()
          Get an instance of the given object in this pool
 DTMIterator getInstanceOrThrow()
          Get an instance of the given object in this pool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_orig

private final DTMIterator m_orig
Type of objects in this pool.


m_freeStack

private final Vector m_freeStack
Vector of given objects this points to.

Constructor Detail

IteratorPool

public IteratorPool(DTMIterator original)
Constructor IteratorPool

Parameters:
original - The original iterator from which all others will be cloned.
Method Detail

getInstanceOrThrow

public DTMIterator getInstanceOrThrow()
                               throws CloneNotSupportedException
Get an instance of the given object in this pool

Returns:
An instance of the given object
Throws:
CloneNotSupportedException

getInstance

public DTMIterator getInstance()
Get an instance of the given object in this pool

Returns:
An instance of the given object

freeInstance

public void freeInstance(DTMIterator obj)
Add an instance of the given object to the pool

Parameters:
obj - Object to add.