public final class DefaultTickUnitSupplier extends Object implements TickUnitSupplier
The multipliers (factors) can be specified during the construction. They are expected to be numbers between 1
(inclusive) and 10 (exclusive). See computeTickUnit(double) for more details.
| Constructor and Description |
|---|
DefaultTickUnitSupplier()
Creates a new instance of
DefaultTickUnitSupplier initialized with multipliers: [1, 2.5, 5]. |
DefaultTickUnitSupplier(SortedSet<? extends Number> multipliers)
Creates a new instance of
DefaultTickUnitSupplier with specified multipliers. |
| Modifier and Type | Method and Description |
|---|---|
double |
computeTickUnit(double referenceTickUnit)
Computes tick unit using the following formula: tickUnit = M*10^E, where M is one of the multipliers specified in
the constructor and E is an exponent of 10.
|
public DefaultTickUnitSupplier()
DefaultTickUnitSupplier initialized with multipliers: [1, 2.5, 5].public double computeTickUnit(double referenceTickUnit)
For example with multipliers [1, 2, 5], the method will give the following results:
computeTickUnit(0.01) returns 0.01 computeTickUnit(0.42) returns 0.5 computeTickUnit(1.73) returns 2 computeTickUnit(5) returns 5 computeTickUnit(27) returns 50
computeTickUnit in interface TickUnitSupplierreferenceTickUnit - the reference tick unit, must be a positive numberCopyright © 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH. All rights reserved.