Class ByteRangeMap

  • All Implemented Interfaces:
    java.io.Serializable

    public class ByteRangeMap
    extends java.lang.Object
    implements java.io.Serializable
    Stores ranges of byte values throughout "long" space. Every "long" index has an associated byte value (initially 0). Users can paint (set) ranges of indexes to a given byte value, overwriting any value that currently exists in that range. This class is implemented using an BytePropertySet. The first index (0) will always contain a value. The value at any other given index will either be the value stored at that index, or if no value stored there, then the value stored at the nearest previous index that contains a value.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ByteRangeMap()
      Constructor for RangeMap.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      LongIterator getChangePointIterator​(long start, long end)
      Returns an iterator over all indexes where the values changes.
      IndexRangeIterator getIndexRangeIterator​(long index)
      returns an iterator over the ranges
      byte getValue​(long index)
      Returns the int value associated with the given index.
      void paintRange​(long start, long end, byte value)
      Associates the given value with every index from start to end (inclusive) Any previous associates are overwritten.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ByteRangeMap

        public ByteRangeMap()
        Constructor for RangeMap.
    • Method Detail

      • paintRange

        public void paintRange​(long start,
                               long end,
                               byte value)
        Associates the given value with every index from start to end (inclusive) Any previous associates are overwritten.
        Parameters:
        start - the start index of the range to fill.
        end - the end index of the range to fill
        value - the value to put at every index in the range.
      • getValue

        public byte getValue​(long index)
        Returns the int value associated with the given index.
        Parameters:
        index - the index at which to get the value.
      • getIndexRangeIterator

        public IndexRangeIterator getIndexRangeIterator​(long index)
        returns an iterator over the ranges
        Parameters:
        index - index to start the iterator
        Returns:
        IndexRangeIterator the iterator over the index ranges
      • getChangePointIterator

        public LongIterator getChangePointIterator​(long start,
                                                   long end)
        Returns an iterator over all indexes where the values changes.
        Parameters:
        start - start index of iterator
        end - end index of iterator
        Returns:
        LongIterator the iterator over index values that represent changes in values.