public final class MathHelper

  1. Object
  2. MathHelper
Utility class for math operations.

Fields

public static final double NULL_VALUE = -1.7976931348623157E308A value that is used a null value.

Methods

public static double[] minmax(List<Double> values)Calculate the minimum and maximum values out of a list of doubles.
public static List<Double> getLabels(double start, double end, int approxNumLabels)Computes a reasonable set of labels for a data interval and number of labels.

Inherited methods

Field details

NULL_VALUE

public static final double NULL_VALUE = -1.7976931348623157E308
A value that is used a null value.

Method details

minmax

public static double[] minmax(List<Double> values)
Calculate the minimum and maximum values out of a list of doubles.

Parameters

values List<Double>
the input values

Returns

an array with the minimum and maximum values

getLabels

public static List<Double> getLabels(double start, double end, int approxNumLabels)
Computes a reasonable set of labels for a data interval and number of labels.

Parameters

start double
start value
end double
final value
approxNumLabels int
desired number of labels

Returns

collection containing the label values