public abstract class TickUnit extends java.lang.Object implements java.lang.Comparable, java.io.Serializable
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.
ValueAxis
,
Serialized FormConstructor and Description |
---|
TickUnit(double size)
Constructs a new tick unit.
|
TickUnit(double size,
int minorTickCount)
Constructs a new tick unit.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object object)
Compares this tick unit to an arbitrary object.
|
boolean |
equals(java.lang.Object obj)
Tests this unit for equality with another object.
|
int |
getMinorTickCount()
Returns the minor tick count.
|
double |
getSize()
Returns the size of the tick unit.
|
int |
hashCode()
Returns a hash code for this instance.
|
java.lang.String |
valueToString(double value)
Converts the supplied value to a string.
|
public TickUnit(double size)
size
- the tick unit size.public TickUnit(double size, int minorTickCount)
size
- the tick unit size.minorTickCount
- the minor tick count.public double getSize()
public int getMinorTickCount()
public java.lang.String valueToString(double value)
Subclasses may implement special formatting by overriding this method.
value
- the data value.public int compareTo(java.lang.Object object)
compareTo
in interface java.lang.Comparable
object
- the object to compare against.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.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object.true
or false
.public int hashCode()
hashCode
in class java.lang.Object