Package org.jfree.chart.axis
Class TickUnit
- java.lang.Object
-
- org.jfree.chart.axis.TickUnit
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable
- Direct Known Subclasses:
DateTickUnit,NumberTickUnit
public abstract class TickUnit extends java.lang.Object implements java.lang.Comparable, java.io.SerializableBase 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:
ValueAxis, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private intminorTickCountThe number of minor ticks.private static longserialVersionUIDFor serialization.private doublesizeThe size of the tick unit.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(java.lang.Object object)Compares this tick unit to an arbitrary object.booleanequals(java.lang.Object obj)Tests this unit for equality with another object.intgetMinorTickCount()Returns the minor tick count.doublegetSize()Returns the size of the tick unit.inthashCode()Returns a hash code for this instance.java.lang.StringvalueToString(double value)Converts the supplied value to a string.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
size
private double size
The size of the tick unit.
-
minorTickCount
private int minorTickCount
The number of minor ticks.
-
-
Method Detail
-
getSize
public double getSize()
Returns the size of the tick unit.- Returns:
- The size of the tick unit.
-
getMinorTickCount
public int getMinorTickCount()
Returns the minor tick count.- Returns:
- The minor tick count.
-
valueToString
public java.lang.String valueToString(double value)
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
public int compareTo(java.lang.Object object)
Compares this tick unit to an arbitrary object.- Specified by:
compareToin interfacejava.lang.Comparable- Parameters:
object- the object to compare against.- Returns:
1if the size of the other object is less than this,0if both have the same size and-1this size is less than the others.
-
equals
public boolean equals(java.lang.Object obj)
Tests this unit for equality with another object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object.- Returns:
trueorfalse.
-
hashCode
public int hashCode()
Returns a hash code for this instance.- Overrides:
hashCodein classjava.lang.Object- Returns:
- A hash code.
-
-