| |
|
| java.lang.Object com.vividsolutions.jump.geom.precision.NumberPrecisionReducer
NumberPrecisionReducer | public class NumberPrecisionReducer (Code) | | Reduces the precision of a number
by rounding it off after scaling by a given scale factor.
|
Constructor Summary | |
public | NumberPrecisionReducer() | public | NumberPrecisionReducer(double scaleFactor) A negative value for scaleFactor indicates
that the precision reduction will eliminate significant digits
to the left of the decimal point.
(I.e. |
Method Summary | |
public double | reducePrecision(double d) | public static double | scaleFactorForDecimalPlaces(int decimalPlaces) Computes the scale factor for a given number of decimal places.
A negative value for decimalPlaces indicates the scale factor
should be divided rather than multiplied. | public void | setScaleFactor(double scaleFactor) |
NumberPrecisionReducer | public NumberPrecisionReducer()(Code) | | |
NumberPrecisionReducer | public NumberPrecisionReducer(double scaleFactor)(Code) | | A negative value for scaleFactor indicates
that the precision reduction will eliminate significant digits
to the left of the decimal point.
(I.e. the scale factor
will be divided rather than multiplied).
A zero value for scaleFactor will result in no precision reduction being performed.
A scale factor is normally an integer value.
Parameters: scaleFactor - |
reducePrecision | public double reducePrecision(double d)(Code) | | |
scaleFactorForDecimalPlaces | public static double scaleFactorForDecimalPlaces(int decimalPlaces)(Code) | | Computes the scale factor for a given number of decimal places.
A negative value for decimalPlaces indicates the scale factor
should be divided rather than multiplied. The negative sign
is carried through to the computed scale factor.
Parameters: decimalPlaces - the scale factor |
setScaleFactor | public void setScaleFactor(double scaleFactor)(Code) | | |
|
|
|