Class NumberTickUnit

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable

    public class NumberTickUnit
    extends TickUnit
    implements java.io.Serializable
    A numerical tick unit.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.text.NumberFormat formatter
      A formatter for the tick unit.
      private static long serialVersionUID
      For serialization.
    • Constructor Summary

      Constructors 
      Constructor Description
      NumberTickUnit​(double size)
      Creates a new number tick unit.
      NumberTickUnit​(double size, java.text.NumberFormat formatter)
      Creates a new number tick unit.
      NumberTickUnit​(double size, java.text.NumberFormat formatter, int minorTickCount)
      Creates a new number tick unit.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Tests this formatter for equality with an arbitrary object.
      int hashCode()
      Returns a hash code for this instance.
      java.lang.String toString()
      Returns a string representing this unit.
      java.lang.String valueToString​(double value)
      Converts a value to a string.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        For serialization.
        See Also:
        Constant Field Values
      • formatter

        private java.text.NumberFormat formatter
        A formatter for the tick unit.
    • Constructor Detail

      • NumberTickUnit

        public NumberTickUnit​(double size)
        Creates a new number tick unit.
        Parameters:
        size - the size of the tick unit.
      • NumberTickUnit

        public NumberTickUnit​(double size,
                              java.text.NumberFormat formatter)
        Creates a new number tick unit.
        Parameters:
        size - the size of the tick unit.
        formatter - a number formatter for the tick unit (null not permitted).
      • NumberTickUnit

        public NumberTickUnit​(double size,
                              java.text.NumberFormat formatter,
                              int minorTickCount)
        Creates a new number tick unit.
        Parameters:
        size - the size of the tick unit.
        formatter - a number formatter for the tick unit (null not permitted).
        minorTickCount - the number of minor ticks.
    • Method Detail

      • valueToString

        public java.lang.String valueToString​(double value)
        Converts a value to a string.
        Overrides:
        valueToString in class TickUnit
        Parameters:
        value - the value.
        Returns:
        The formatted string.
      • equals

        public boolean equals​(java.lang.Object obj)
        Tests this formatter for equality with an arbitrary object.
        Overrides:
        equals in class TickUnit
        Parameters:
        obj - the object (null permitted).
        Returns:
        A boolean.
      • toString

        public java.lang.String toString()
        Returns a string representing this unit.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string.
      • hashCode

        public int hashCode()
        Returns a hash code for this instance.
        Overrides:
        hashCode in class TickUnit
        Returns:
        A hash code.