Class IteratorTransform<I,T>
java.lang.Object
org.apache.commons.geometry.core.internal.IteratorTransform<I,T>
- Type Parameters:
I
- Input iterator typeT
- Output iterator type
- All Implemented Interfaces:
Iterator<T>
- Direct Known Subclasses:
AbstractRegionBSPTree.RegionBoundaryIterator
Class that wraps another iterator, converting each input iterator value into
one or more output iterator values.
-
Field Summary
FieldsModifier and TypeFieldDescriptionInput iterator instance that supplies the input values for this instance.Output value queue. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
IteratorTransform
(Iterator<I> inputIterator) Create a new instance that uses the given iterator as the input source. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
acceptInput
(I input) Accept a value from the input iterator.protected void
addAllOutput
(Collection<T> values) Add multiple values to the output queue.protected void
Add a value to the output queue.boolean
hasNext()
private boolean
Load the next output values into the output queue.next()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Field Details
-
inputIterator
Input iterator instance that supplies the input values for this instance. -
outputQueue
Output value queue.
-
-
Constructor Details
-
IteratorTransform
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() -
next
-
loadNextOutput
private boolean loadNextOutput()Load the next output values into the output queue. Returns true if the output queue contains more entries.- Returns:
- true if more output values are available
-
addOutput
Add a value to the output queue.- Parameters:
value
- value to add to the output queue
-
addAllOutput
Add multiple values to the output queue.- Parameters:
values
- values to add to the output queue
-
acceptInput
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
-