AndBase开发框架  1.6
 全部  命名空间 文件 函数 变量 枚举值 
静态 Public 成员函数 | 静态 Public 属性 | Private 成员函数 | 静态 Private 成员函数 | 静态 Private 属性 | 所有成员列表
com.ab.view.chart.MathHelper类 参考

静态 Public 成员函数

static double[] minmax (List< Double > values)
 
static List< Double > getLabels (final double start, final double end, final int approxNumLabels)
 
static float[] getFloats (List< Float > values)
 
static double[] getDoubles (List< Double > values)
 
static int[] getInts (List< Integer > values)
 

静态 Public 属性

static final double NULL_VALUE = Double.MAX_VALUE
 

Private 成员函数

 MathHelper ()
 

静态 Private 成员函数

static double[] computeLabels (final double start, final double end, final int approxNumLabels)
 
static double roundUp (final double val)
 

静态 Private 属性

static final NumberFormat FORMAT = NumberFormat.getNumberInstance()
 

详细描述

Utility class for math operations.

构造及析构函数说明

com.ab.view.chart.MathHelper.MathHelper ( )
inlineprivate

Instantiates a new math helper.

成员函数说明

static double [] com.ab.view.chart.MathHelper.computeLabels ( final double  start,
final double  end,
final int  approxNumLabels 
)
inlinestaticprivate

Computes a reasonable number of labels for a data range.

参数
startstart value
endfinal value
approxNumLabelsdesired number of labels
返回
double[] array containing {start value, end value, increment}
static double [] com.ab.view.chart.MathHelper.getDoubles ( List< Double >  values)
inlinestatic

Transforms a list of Double values into an array of double.

参数
valuesthe list of Double
返回
the array of doubles
static float [] com.ab.view.chart.MathHelper.getFloats ( List< Float >  values)
inlinestatic

Transforms a list of Float values into an array of float.

参数
valuesthe list of Float
返回
the array of floats
static int [] com.ab.view.chart.MathHelper.getInts ( List< Integer >  values)
inlinestatic

Gets the ints.

参数
valuesthe values
返回
the ints
static List<Double> com.ab.view.chart.MathHelper.getLabels ( final double  start,
final double  end,
final int  approxNumLabels 
)
inlinestatic

Computes a reasonable set of labels for a data interval and number of labels.

参数
startstart value
endfinal value
approxNumLabelsdesired number of labels
返回
collection containing {start value, end value, increment}
static double [] com.ab.view.chart.MathHelper.minmax ( List< Double >  values)
inlinestatic

Calculate the minimum and maximum values out of a list of doubles.

参数
valuesthe input values
返回
an array with the minimum and maximum values
static double com.ab.view.chart.MathHelper.roundUp ( final double  val)
inlinestaticprivate

Given a number, round up to the nearest power of ten times 1, 2, or 5. The argument must be strictly positive.

参数
valthe val
返回
the double

类成员变量说明

final NumberFormat com.ab.view.chart.MathHelper.FORMAT = NumberFormat.getNumberInstance()
staticprivate

A number formatter to be used to make sure we have a maximum number of fraction digits in the labels.

final double com.ab.view.chart.MathHelper.NULL_VALUE = Double.MAX_VALUE
static

A value that is used a null value.


该类的文档由以下文件生成: