Package hec.lang

Class ScaleBobz

java.lang.Object
hec.lang.ScaleBobz

public class ScaleBobz extends Object
Title: ScaleBobz - Computes scale for tabulations Description: Provides capability of scaling data to be "nice" numbers for a selected number of divisions or range of divisions from user supllied minimum and maximum data values. Useful for determining axis labeling and array of stages for stage-damage. It uses x*10**n where x is 1, 2, or 5 (plus or minus). Company:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    main(String[] args)
     
    static int
    scaleValues(int i1_div, int i2_div, double[] base_number, int nu_base_number, double d_min, double d_max, double[] scaleParams)
    Scale the range of data from d_min through d_max broken into the best number of intervals between i1_div and i2_div (they may be equal).
    static int
    scaleValues(int i1_div, int i2_div, double d_min, double d_max, double[] scaleParams)
    Scale the range of data from d_min through d_max broken into the best number of intervals between i1_div and i2_div (they may be equal).

    Methods inherited from class java.lang.Object

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

    • ScaleBobz

      public ScaleBobz()
  • Method Details

    • scaleValues

      public static int scaleValues(int i1_div, int i2_div, double d_min, double d_max, double[] scaleParams)
      Scale the range of data from d_min through d_max broken into the best number of intervals between i1_div and i2_div (they may be equal). You must have allocated scaleParams[3] before calling this routine as it contains the results. It also returns the number of divisions. returns number of divisions scaleParams is min, max, interval ------------------------------------------------------------------ Input Arguments i1_div Minimum number of class intervals i2_div Maximum number of class intervals d_min Minimum value of the data d_max Maximum value of data Output Results ns_div Number of class intervals (between i1_div and i2_div inclusive) ds_min Minimum (starting) value for class intervals (scaleParams[0]) ds_max Maximum (ending) value for class intervals (scaleParams[1]) ds_intrvl Interval between each class interval (scaleParams[2])
    • scaleValues

      public static int scaleValues(int i1_div, int i2_div, double[] base_number, int nu_base_number, double d_min, double d_max, double[] scaleParams)
      Scale the range of data from d_min through d_max broken into the best number of intervals between i1_div and i2_div (they may be equal). You must have allocated scaleParams[3] before calling this routine as it contains the results. It also returns the number of divisions. returns number of divisions scaleParams is min, max, interval ------------------------------------------------------------------ Input Arguments i1_div Minimum number of class intervals i2_div Maximum number of class intervals base_number Array of numbers to use for determining class interval nu_base_number Number of values in base_number. If set to zero, scalev will use three values: 1, 2, 5. d_min Minimum value of the data d_max Maximum value of data Output Results ns_div Number of class intervals (between i1_div and i2_div inclusive) ds_min Minimum (starting) value for class intervals (scaleParams[0]) ds_max Maximum (ending) value for class intervals (scaleParams[1]) ds_intrvl Interval between each class interval (scaleParams[2])
    • main

      public static void main(String[] args)