Class LevelMode


  • @Equality
    public abstract class LevelMode
    extends java.lang.Object
    Defines a strategy for calculating contour level values from an array of data.
    Since:
    17 Feb 2013
    Author:
    Mark Taylor
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static LevelMode EQU
      Equal-area scaling - levels are spaced to provide equally sized inter-contour regions.
      static LevelMode LINEAR
      Linear scaling - level values are equally spaced.
      static LevelMode LOG
      Logarithmic scaling - level logarithms are equally spaced
      static LevelMode[] MODES
      Known level mode instances.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected LevelMode​(java.lang.String name, java.lang.String description)
      Constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract double[] calculateLevels​(NumberArray array, int nLevel, double offset, boolean isCounts)
      Calculates the contour levels for a given data array.
      java.lang.String getDescription()
      Returns a short description of this mode.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • LINEAR

        public static LevelMode LINEAR
        Linear scaling - level values are equally spaced.
      • LOG

        public static LevelMode LOG
        Logarithmic scaling - level logarithms are equally spaced
      • EQU

        public static LevelMode EQU
        Equal-area scaling - levels are spaced to provide equally sized inter-contour regions.
      • MODES

        public static final LevelMode[] MODES
        Known level mode instances.
    • Constructor Detail

      • LevelMode

        protected LevelMode​(java.lang.String name,
                            java.lang.String description)
        Constructor.
        Parameters:
        name - mode name
        description - short description of mode
    • Method Detail

      • calculateLevels

        public abstract double[] calculateLevels​(NumberArray array,
                                                 int nLevel,
                                                 double offset,
                                                 boolean isCounts)
        Calculates the contour levels for a given data array.
        Parameters:
        array - data array; NaN elements are permitted and ignored
        nLevel - number of requested levels; actual level count may not be the same as this depending on data
        offset - offset from zero of the value of the first contour, expected in the range 0..1; adjusting this will sweep contours over all positions
        isCounts - true if the values are counts rather than continuously varying; if true, some adjustments are made on the basis of the assumption that differences of scale smaller than 1 don't make much sense
      • getDescription

        public java.lang.String getDescription()
        Returns a short description of this mode.
        Returns:
        description
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object