|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlt.monarch.chart.mapper.LogMathRange
public class LogMathRange extends java.lang.Object implements Range<java.lang.Double>, java.io.Serializable
Manages a range of double values. Any value passed to this class is converted to logarithm of a given value. So this class can work with large ranges.
LogAxisRange,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected double |
base
Logarithm base |
protected double |
firstMark
|
protected double |
max
|
protected double |
min
|
protected double |
precision
|
protected int |
precisionPlaces
|
protected double |
requestedMax
|
protected double |
requestedMin
|
protected double |
step
Used for steps determination |
protected int |
steps
|
| Constructor and Description |
|---|
LogMathRange(double min,
double max)
Creates the logarithmic mathematical range with specified smallest and biggest values. |
LogMathRange(double min,
double max,
double base)
Creates the logarithmical mathematical range with specified smallest and biggest range values and logarithm base. |
| Modifier and Type | Method and Description |
|---|---|
void |
adjustRange()
Updates and adjusts range. |
void |
adjustStep()
Adjusts the step to the specified range |
protected void |
determineStepCount()
Determines count of steps in the range |
protected double |
findFirstMark()
Finds the first mark in the range |
java.lang.String |
format(double val)
Returns a string representation of the specified double value. |
double |
getBase()
Returns base of logarithm used in the range. |
double |
getFirstMark()
Returns the value of the first mark in the range. |
java.text.DecimalFormat |
getLastNumberFormat()
Gets the lastNumberFormat value |
java.lang.Double |
getMaximum()
Gets the end (biggest value) of the range. |
java.lang.Double |
getMinimum()
Gets the beginning of the range. |
int |
getPrecisionPlaces()
Gets the precision places |
double |
getRange()
Returns the width of the range. |
double |
getStep()
Returns step. |
int |
getStepCount()
Returns the step count in the range. |
boolean |
inRange(double v)
Checks if v is in the range. |
protected double |
lg(double x)
Returns the logarithm of a double value. |
double |
map(double value)
Finds the position for the value in the range. |
double |
mapBack(double pos)
Converts the position in the range axis to the double value. |
void |
setBase(double base)
Set base of logarithm used in the range. |
void |
setPrecisionPlaces(int places)
Sets precision places for this range. |
void |
setRange(double min,
double max)
Sets the range for this LogMathRange object. |
void |
setRange(Range<java.lang.Double> r)
Sets the range for this LogMathRange object. |
void |
setRangeMinimum(double m)
Sets the beginning of the range. |
void |
setStep(double step)
Sets a step size for this range. |
void |
updateRange(double d)
Updates the range so that d will be in the range. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected double min
protected double max
protected double firstMark
protected double requestedMin
protected double requestedMax
protected double step
protected int steps
protected int precisionPlaces
protected double precision
protected double base
| Constructor Detail |
|---|
public LogMathRange(double min,
double max)
min - The smallest range valuemax - The biggest range valuejava.lang.IllegalArgumentException - if min >= max or
min <= 0
public LogMathRange(double min,
double max,
double base)
min - The smallest range valuemax - The biggest range valuebase - java.lang.IllegalArgumentException - if min >= max,
min <= 0 or base <=
0| Method Detail |
|---|
protected double lg(double x)
setBase method.
x - a number greater than 0.0
public void setRange(double min,
double max)
min - The new smallest range valuemax - The new biggest range valuejava.lang.IllegalArgumentException - if min >= max or
min <= 0public void setRange(Range<java.lang.Double> r)
Range
object.
r - The new rangeRangepublic void setRangeMinimum(double m)
m - The new beginning of the rangepublic java.lang.Double getMinimum()
getMinimum in interface Range<java.lang.Double>public java.lang.Double getMaximum()
getMaximum in interface Range<java.lang.Double>public final int getStepCount()
public final double getStep()
public final double getRange()
public final double getFirstMark()
public void updateRange(double d)
d will be in the range. Parameter d must be greater
than 0.
d - double valuejava.lang.IllegalArgumentException - if d <= 0.public double map(double value)
value in the range. Parameter d must be greater
than 0.
value - double valuevalue in the rangejava.lang.IllegalArgumentException - if value <= 0.public double mapBack(double pos)
pos - Position in the range. Must be in range [0,1]public void adjustRange()
public final boolean inRange(double v)
v is in the range.
v - double valuev is in the range, false - otherwisejava.lang.IllegalArgumentException - if v <= 0protected double findFirstMark()
protected void determineStepCount()
public double getBase()
public void setBase(double base)
base - base of logarithm.java.lang.IllegalArgumentException - if base <= 0public java.lang.String format(double val)
val - the double value to format.setPrecisionPlaces(int)public void setPrecisionPlaces(int places)
places - the number of precision placespublic void setStep(double step)
step - the step size; a number greater than 0.0.public void adjustStep()
public int getPrecisionPlaces()
public java.text.DecimalFormat getLastNumberFormat()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||