|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.approximatrix.charting.ChartUtilities
public class ChartUtilities
This class offers multiple static methods to perform mathematical operations concerning the Chart, e.g. methods for rounding the minimal and maximal x-values gracefully.
| Constructor Summary | |
|---|---|
ChartUtilities()
|
|
| Method Summary | |
|---|---|
static void |
addDataToSet(java.util.TreeSet set,
java.lang.Number[][] data)
Adds a two-dimensional array to a TreeSet. |
static double |
calculateTickSpacing(double min,
double max)
Calculates the best tick spacing for the rounded minimal and maximal values. |
static double |
ceil(double d,
int exp)
This method returns the smallest double value that is smaller than d = x * 10exp where x is rounded up to
the closest integer. |
static int |
exp(double d)
A double value can be represented like d = x * 10exp and this method returns
the value of exp for a double d. |
static double |
floor(double d,
int exp)
This method returns the largest double value that is smaller than d = x * 10exp where x is rounded down to
the closest integer. |
static double |
interpolate(double[] xa,
double[] ya,
double x)
This function performs a polynomial interpolation using a set of given x and y values. |
static void |
main(java.lang.String[] args)
A test routine. |
static double[] |
performAutoScale(double min,
double max)
This method calculates the optimal rounding for the minimal and maximal ChartModel values. |
static java.lang.Number[] |
transformArray(double[] data)
Transforms an array of primitives to an array of Numbers. |
static java.lang.Number[][] |
transformArray(double[][] data)
Transforms a two-dimensional array of primitives to an array of Numbers. |
static java.lang.Number[] |
transformArray(int[] data)
Transforms an array of primitives to an array of Numbers. |
static java.lang.Number[][] |
transformArray(int[][] data)
Transforms a two-dimensional array of primitives to an array of Numbers. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ChartUtilities()
| Method Detail |
|---|
public static double[] performAutoScale(double min,
double max)
min - the minimal column value of the ChartDataModelmax - the maximal column value of the ChartDataModel
public static double calculateTickSpacing(double min,
double max)
min - the rounded minimal valuemax - the rounded maximal value
public static double interpolate(double[] xa,
double[] ya,
double x)
xa - the array of known x-valuesya - the array of known y-valuesx - the x value for which the y value will be computed
public static double floor(double d,
int exp)
d = x * 10exp where x is rounded down to
the closest integer.
d - the double value to be roundedexp - the exponent of 10 to which d should be rounded
Math.floor(x) * 10exp
public static double ceil(double d,
int exp)
d = x * 10exp where x is rounded up to
the closest integer.
d - the double value to be roundedexp - the exponent of 10 to which d should be rounded
Math.ceil(x) * 10exppublic static int exp(double d)
d = x * 10exp and this method returns
the value of exp for a double d.
d - the double value
public static java.lang.Number[][] transformArray(int[][] data)
public static java.lang.Number[][] transformArray(double[][] data)
public static java.lang.Number[] transformArray(double[] data)
public static java.lang.Number[] transformArray(int[] data)
public static void addDataToSet(java.util.TreeSet set,
java.lang.Number[][] data)
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||