kcl.waterloo.graphics.transforms
Interface GJDataTransformInterface
-
- All Known Implementing Classes:
- GJAbstractDataTransform, Log10Transform, Log2Transform, LogTransform, NOPTransform, PTransform
public interface GJDataTransformInterfaceProvides facilities to transform data from the plots and to provide string and grid position data for the graph The interface needs to be implemented by classes providing e.g. a log transform of the plotted data and axes
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description java.util.ArrayList<java.lang.Double>getAxisTickPositions(double start, double stop, double inc)doublegetData(double val)Transforms and returns a single value.double[]getData(double[] arr)Transforms and returns an array of values.doublegetInverse(double val)Returns the inverse transform of the specified value.double[]getInverse(double[] val)Returns the inverse transform of the specified array.java.util.ArrayList<java.lang.Double>getMinorGridPositions(double start, double stop, double inc, int n)java.lang.StringgetName()The name for this transform as a Stringjava.lang.ObjectgetTickLabel(double val)Returns a String based on the input value which can be used to label the axes.
-
-
-
Method Detail
-
getName
java.lang.String getName()
The name for this transform as a String- Returns:
- a name
-
getData
double getData(double val)
Transforms and returns a single value.- Parameters:
val- the value to transform- Returns:
- the transformed value
-
getData
double[] getData(double[] arr)
Transforms and returns an array of values. Note that, as any concrete implementation can transform the src array by reference, it is recommended that src be a defensive copy of the required input. An output is required for pass-by-value systems like MATLAB- Parameters:
arr- array to transform- Returns:
- a tranformed array that may be a reference to src or a copy.
-
getInverse
double getInverse(double val)
Returns the inverse transform of the specified value. Returns Double.NaN if the method is not implemented.- Parameters:
val-- Returns:
- a double value
-
getInverse
double[] getInverse(double[] val)
Returns the inverse transform of the specified array. Returns Double.NaNs if the method is not implemented.- Parameters:
val-- Returns:
- a double[]
-
getTickLabel
java.lang.Object getTickLabel(double val)
Returns a String based on the input value which can be used to label the axes. The output string can be empty if no label is required- Parameters:
val-- Returns:
- an Object
-
getAxisTickPositions
java.util.ArrayList<java.lang.Double> getAxisTickPositions(double start, double stop, double inc)- Parameters:
start- typically the left-hand/bottom of the axis rangestop- typically the right-hand/top of the axis rangeinc- distance between major grids- Returns:
- values for the major grid positions (already transformed)
-
getMinorGridPositions
java.util.ArrayList<java.lang.Double> getMinorGridPositions(double start, double stop, double inc, int n)- Parameters:
start-stop-inc-n- number of minor grid positions- Returns:
- values for the minor grid positions (n-2 entries as the 0th and nth coincide with the major grid). These values should be added to the axis tick positions to get the minor grid positions (already transformed)
-
-
DMelt 3.0 © DataMelt by jWork.ORG