Class IteratorTransform<I,T>

java.lang.Object
org.apache.commons.geometry.core.internal.IteratorTransform<I,T>
Type Parameters:
I - Input iterator type
T - Output iterator type
All Implemented Interfaces:
Iterator<T>

public abstract class IteratorTransform<I,T> extends Object implements Iterator<T>
Class that wraps another iterator, converting each input iterator value into one or more output iterator values.
  • Constructor Details

    • IteratorTransform

      protected IteratorTransform(Iterator<I> inputIterator)
      Create a new instance that uses the given iterator as the input source.
      Parameters:
      inputIterator - iterator supplying input values
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<I>
    • next

      public T next()
      Specified by:
      next in interface Iterator<I>
    • addOutput

      protected void addOutput(T value)
      Add a value to the output queue.
      Parameters:
      value - value to add to the output queue
    • addAllOutput

      protected void addAllOutput(Collection<T> values)
      Add multiple values to the output queue.
      Parameters:
      values - values to add to the output queue
    • acceptInput

      protected abstract void acceptInput(I input)
      Accept a value from the input iterator. This method should take the input value and add one or more values to the output queue.
      Parameters:
      input - value from the input iterator