Class AddressRangeChunker

  • All Implemented Interfaces:
    java.lang.Iterable<AddressRange>

    public class AddressRangeChunker
    extends java.lang.Object
    implements java.lang.Iterable<AddressRange>
    A class to break a range of addresses into 'chunks' of a give size. This is useful to break-up processing of large swaths of addresses, such as when performing work in a background thread. Doing this allows the client to iterator over the range, pausing enough to allow the UI to update.
    • Constructor Detail

      • AddressRangeChunker

        public AddressRangeChunker​(AddressRange range,
                                   int chunkSize)
                            throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • AddressRangeChunker

        public AddressRangeChunker​(Address start,
                                   Address end,
                                   int chunkSize)
                            throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
    • Method Detail

      • iterator

        public java.util.Iterator<AddressRange> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<AddressRange>