Class TickUnit

  extended by com.jrefinery.chart.TickUnit
All Implemented Interfaces:
Direct Known Subclasses:
DateTickUnit, NumberTickUnit

public abstract class TickUnit
extends java.lang.Object
implements java.lang.Comparable

Base class representing a tick unit. This determines the spacing of the tick marks on an axis.

This class (and 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.

Field Summary
protected  double size
          The size of the tick unit.
Constructor Summary
TickUnit(double size)
          Constructs a new tick unit.
Method Summary
 int compareTo(java.lang.Object object)
          Compares this tick unit to an arbitrary object.
 double getSize()
          Returns the size of the tick unit.
 java.lang.String valueToString(double value)
          Converts the supplied value to a string.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


protected double size
The size of the tick unit.

Constructor Detail


public TickUnit(double size)
Constructs a new tick unit.

size - The tick unit size.
Method Detail


public double getSize()
Returns the size of the tick unit.


public java.lang.String valueToString(double value)
Converts the supplied value to a string.

Subclasses of TickUnit may implement special formatting by overriding this method.

The - data value.


public int compareTo(java.lang.Object object)
Compares this tick unit to an arbitrary object.

Specified by:
compareTo in interface java.lang.Comparable
object - The object to compare against.

Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.