Class LongRangeFactory


  • public class LongRangeFactory
    extends java.lang.Object
    Groups double values into ranges
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long max  
      private long min  
      private long width  
    • Constructor Summary

      Constructors 
      Constructor Description
      LongRangeFactory​(long min, long width, long max)
      Creates a new LongRangeFactory
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      LongRange getRange​(long value, LongRange reuse)
      Finds the LongRange that a value should be grouped into
      • Methods inherited from class java.lang.Object

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

      • min

        private final long min
      • width

        private final long width
      • max

        private final long max
    • Constructor Detail

      • LongRangeFactory

        public LongRangeFactory​(long min,
                                long width,
                                long max)
        Creates a new LongRangeFactory
        Parameters:
        min - a minimum value; all longs below this value are grouped into a single range
        width - a standard width; all ranges between min and max are this wide, with the exception of the final range which may be up to this width. Ranges are inclusive at the lower end, and exclusive at the upper end.
        max - a maximum value; all longs above this value are grouped into a single range
    • Method Detail

      • getRange

        public LongRange getRange​(long value,
                                  LongRange reuse)
        Finds the LongRange that a value should be grouped into
        Parameters:
        value - the value to group
        reuse - an existing LongRange object to reuse