Package org.jfree.chart.axis
Class TickUnit
java.lang.Object
org.jfree.chart.axis.TickUnit
- All Implemented Interfaces:
Serializable
,Comparable
- Direct Known Subclasses:
DateTickUnit
,NumberTickUnit
Base class representing a tick unit. This determines the spacing of the
tick marks on an axis.
This class (and any subclasses) should be immutable, the reason being that ORDERED collections of tick units are maintained and if one instance can be changed, it may destroy the order of the collection that it belongs to. In addition, if the implementations are immutable, they can belong to multiple collections.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Compares this tick unit to an arbitrary object.boolean
Tests this unit for equality with another object.int
Returns the minor tick count.double
getSize()
Returns the size of the tick unit.int
hashCode()
Returns a hash code for this instance.valueToString
(double value) Converts the supplied value to a string.
-
Constructor Details
-
TickUnit
Constructs a new tick unit.- Parameters:
size
- the tick unit size.
-
TickUnit
Constructs a new tick unit.- Parameters:
size
- the tick unit size.minorTickCount
- the minor tick count.
-
-
Method Details
-
getSize
Returns the size of the tick unit.- Returns:
- The size of the tick unit.
-
getMinorTickCount
Returns the minor tick count.- Returns:
- The minor tick count.
-
valueToString
Converts the supplied value to a string.Subclasses may implement special formatting by overriding this method.
- Parameters:
value
- the data value.- Returns:
- Value as string.
-
compareTo
Compares this tick unit to an arbitrary object.- Specified by:
compareTo
in interfaceComparable
- Parameters:
object
- the object to compare against.- Returns:
1
if the size of the other object is less than this,0
if both have the same size and-1
this size is less than the others.
-
equals
Tests this unit for equality with another object. -
hashCode
Returns a hash code for this instance.
-