Package org.jfree.chart.axis
Class NumberTickUnitSource
java.lang.Object
org.jfree.chart.axis.NumberTickUnitSource
- All Implemented Interfaces:
Serializable
,TickUnitSource
A tick unit source implementation that returns NumberTickUnit instances
that are multiples of 1, 2 or 5 times some power of 10.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DecimalFormat
private DecimalFormat
private DecimalFormat
private DecimalFormat
private DecimalFormat
private DecimalFormat
private int
private NumberFormat
The number formatter to use (an override, it can be null).private boolean
private int
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance.NumberTickUnitSource
(boolean integers) Creates a new instance.NumberTickUnitSource
(boolean integers, NumberFormat formatter) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getCeilingTickUnit
(double size) Returns the smallest tick unit available in the source that is greater than or equal to the specified size.getCeilingTickUnit
(TickUnit unit) Returns the tick unit in the collection that is greater than or equal to (in size) the specified unit.getLargerTickUnit
(TickUnit unit) Returns the smallest tick unit available in the source that is larger thanunit
or, if there is no larger unit, returnsunit
.private int
private NumberFormat
private double
private boolean
next()
private boolean
previous()
-
Field Details
-
integers
private boolean integers -
power
private int power -
factor
private int factor -
formatter
The number formatter to use (an override, it can be null). -
dfNeg4
-
dfNeg3
-
dfNeg2
-
dfNeg1
-
df0
-
df
-
-
Constructor Details
-
NumberTickUnitSource
public NumberTickUnitSource()Creates a new instance. -
NumberTickUnitSource
public NumberTickUnitSource(boolean integers) Creates a new instance.- Parameters:
integers
- show integers only.
-
NumberTickUnitSource
Creates a new instance.- Parameters:
integers
- show integers only?formatter
- a formatter for the axis tick labels (null
permitted).
-
-
Method Details
-
getLargerTickUnit
Description copied from interface:TickUnitSource
Returns the smallest tick unit available in the source that is larger thanunit
or, if there is no larger unit, returnsunit
.- Specified by:
getLargerTickUnit
in interfaceTickUnitSource
- Parameters:
unit
- the unit (null
not permitted).- Returns:
- A tick unit that is larger than the supplied unit.
-
getCeilingTickUnit
Description copied from interface:TickUnitSource
Returns the tick unit in the collection that is greater than or equal to (in size) the specified unit.- Specified by:
getCeilingTickUnit
in interfaceTickUnitSource
- Parameters:
unit
- the unit.- Returns:
- A unit from the collection.
-
getCeilingTickUnit
Description copied from interface:TickUnitSource
Returns the smallest tick unit available in the source that is greater than or equal to the specified size. If there is no such tick unit, the method should return the largest available tick in the source.- Specified by:
getCeilingTickUnit
in interfaceTickUnitSource
- Parameters:
size
- the size.- Returns:
- A unit from the collection (never
null
).
-
next
private boolean next() -
previous
private boolean previous() -
getTickSize
private double getTickSize() -
getTickLabelFormat
-
getMinorTickCount
private int getMinorTickCount() -
equals
-