Class Scalings


  • public class Scalings
    extends java.lang.Object
    Implementation class for functions to do with Scaling instances.
    Since:
    21 Mar 2019
    Author:
    Mark Taylor
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean canScale​(Scaling[] scalings, Span dataSpan, Span fixSpan)
      Determines whether all of a list of scalings can be used to create Scaler objects from given span instances.
      static Scaling.RangeScaling createAsinhScaling​(java.lang.String name, double delta)
      Constructs an asinh-based scaling.
      static Ranger createRanger​(Scaling[] scalings)
      Returns a ranger suitable for use with all of a given list of scalings.
      static double unscale​(Scaler scaler, double lo, double hi, double frac)
      Utility method to perform the inverse operation of Scaler.scaleValue.
      • Methods inherited from class java.lang.Object

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

      • createRanger

        public static Ranger createRanger​(Scaling[] scalings)
        Returns a ranger suitable for use with all of a given list of scalings. If a ranger is obtained from this method and used to create a Span, that span's createScaler method can be used with any of the scalings presented here.
        Parameters:
        scalings - list of scalings required for compatibility; null values are permitted, and add no constraints
        Returns:
        suitable ranger
      • canScale

        public static boolean canScale​(Scaling[] scalings,
                                       Span dataSpan,
                                       Span fixSpan)
        Determines whether all of a list of scalings can be used to create Scaler objects from given span instances.
        Parameters:
        scalings - scaling instances for which scalers may be required
        dataSpan - span obtained from ranging data
        fixSpan - span obtained by direct user input of bounds
        Returns:
        true iff spans are sufficient, false if new span instances are going to be needed
      • createAsinhScaling

        public static Scaling.RangeScaling createAsinhScaling​(java.lang.String name,
                                                              double delta)
        Constructs an asinh-based scaling.
        Parameters:
        name - scaling name
        delta - output difference for lower-end input unit difference
        Returns:
        scaling
      • unscale

        public static double unscale​(Scaler scaler,
                                     double lo,
                                     double hi,
                                     double frac)
        Utility method to perform the inverse operation of Scaler.scaleValue.
        Parameters:
        scaler - scaler instance
        lo - lower bound of input data value
        hi - upper bound of input data value
        frac - required output value of scaleValue method, must be in range 0..1
        Returns:
        value x that causes scaler.scaleValue(x) to return frac