Class AddressIteratorAdapter
- All Implemented Interfaces:
AddressIterator, Iterable<Address>, Iterator<Address>
public class AddressIteratorAdapter
extends FlattenedIterator<AddressRange, Address>
implements AddressIterator
Convert an
AddressRange iterator to an AddressIterator.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static class -
Field Summary
Fields inherited from class FlattenedIterator
inner, innerFactory, outer, preppedInnerFields inherited from interface AddressIterator
EMPTY_ITERATOR -
Constructor Summary
ConstructorsConstructorDescriptionAddressIteratorAdapter(Iterator<AddressRange> outer, boolean forward) Construct anAddressIteratorover the given address rangesAddressIteratorAdapter(Iterator<AddressRange> outer, Address start, boolean forward) Construct anAddressIteratorover the given address ranges, truncating the initial range to the given start -
Method Summary
Methods inherited from class FlattenedIterator
hasNext, next, remove, startMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AddressIterator
hasNext, nextMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface Iterator
forEachRemaining, remove
-
Constructor Details
-
AddressIteratorAdapter
Construct anAddressIteratorover the given address ranges- Parameters:
outer- an iterator of address rangesforward- true for forward iteration. Otherwise backward iteration. This flag must be consistent with the order of the given outer iterator.
-
AddressIteratorAdapter
Construct anAddressIteratorover the given address ranges, truncating the initial range to the given start- Parameters:
outer- the iterator of address ranges, the first of which must contain or come after the given start.start- the starting addressforward- true for forward iteration. Otherwise backward iteration. This flag must be consistent with the order of the given outer iterator.o
-
-
Method Details
-
forRange
Iterate over the addresses in the given range- Parameters:
range- the rangeforward- true to iterate forward, false for backward- Returns:
- the iterable
-
iterator
-