Class BasicRanger

  • All Implemented Interfaces:
    Ranger

    public class BasicRanger
    extends java.lang.Object
    implements Ranger
    Ranger implementation that just keeps track of high and low values.
    Since:
    14 Mar 2019
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Constructor Description
      BasicRanger​(boolean isBestEfforts)
      Constructor.
    • Constructor Detail

      • BasicRanger

        public BasicRanger​(boolean isBestEfforts)
        Constructor.
        Parameters:
        isBestEfforts - whether best efforts ranging should be done without complaint for inappropriate scalings
    • Method Detail

      • submitDatum

        public void submitDatum​(double datum)
        Description copied from interface: Ranger
        Accepts a data value.
        Specified by:
        submitDatum in interface Ranger
        Parameters:
        datum - datum
      • createSpan

        public Span createSpan()
        Description copied from interface: Ranger
        Returns an object characterising the range of data submitted so far. This should not be called while another thread might be calling Ranger.submitDatum(double).
        Specified by:
        createSpan in interface Ranger
        Returns:
        span of accumulated data
      • calculateFiniteBounds

        public static double[] calculateFiniteBounds​(double lo,
                                                     double hi,
                                                     boolean isPositive)
        Returns a 2-element array giving definite lower and upper bounds based on known lower and upper values. The upper bound will be strictly greater than the lower bound. Optionally, both bounds can be required to be strictly greater than zero. If the input values are insufficient to determine such return values, some reasonable defaults will be made up.
        Parameters:
        lo - input lower bound, may be NaN
        hi - input upper bound, may be NaN
        isPositive - if true, output bounds must be positive
        Returns:
        2-element array giving (lo,hi)
      • createRangeScaler

        public static Scaler createRangeScaler​(Scaling.RangeScaling rscaling,
                                               Subrange dataclip,
                                               Span span)
        Returns a scaler based on a RangeScaling.
        Parameters:
        rscaling - scaling of range type
        dataclip - input data range adjustment
        span - data range information
        Returns:
        new scaler