Class IteratorPool

java.lang.Object
org.htmlunit.xpath.axes.IteratorPool

public final class IteratorPool extends Object
Pool of object of a given type to pick from to help memory usage
  • Field Details

    • m_orig

      private final DTMIterator m_orig
      Type of objects in this pool.
    • m_freeStack

      private final ArrayList<DTMIterator> m_freeStack
      Stack of given objects this points to.
  • Constructor Details

    • IteratorPool

      public IteratorPool(DTMIterator original)
      Constructor IteratorPool
      Parameters:
      original - The original iterator from which all others will be cloned.
  • Method Details

    • 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.