Class MultiAddressRangeIterator


  • public class MultiAddressRangeIterator
    extends java.lang.Object
    MultiAddressRangeIterator is a class for iterating through multiple address range iterators simultaneously. The next() method returns the next address range as determined from all the iterators.
    • Constructor Detail

      • MultiAddressRangeIterator

        public MultiAddressRangeIterator​(AddressRangeIterator[] iters)
        Constructor of a multi address iterator for multiple forward address iterators.
        Parameters:
        iters - the address iterators.
      • MultiAddressRangeIterator

        public MultiAddressRangeIterator​(AddressRangeIterator[] iters,
                                         boolean forward)
        Constructor of a multi address range iterator.
        Note: all iterators must iterate in the same direction (forwards or backwards).
        Parameters:
        iters - the address iterators. All must iterate in the direction indicated by the "forward" parameter.
        forward - true indicates that forward iterators are in the array. false indicates backward iterators are in the array.
    • Method Detail

      • hasNext

        public boolean hasNext()
        Determines whether or not any of the original iterators has a next address.
        Returns:
        true if a next address can be obtained from any of the address iterators.
      • next

        public AddressRange next()
        Returns the next address. The next address could be from any one of the iterators.
        Returns:
        the next address.
      • forwardNext

        public AddressRange forwardNext()
        Returns the next address for forward iterators. The next address could be from any one of the iterators.
        Returns:
        the next address.
      • backwardNext

        public AddressRange backwardNext()
        Returns the next address for backward iterators. The next address could be from any one of the iterators.
        Returns:
        the next address.