Documentation of 'jas2.plot.TimeAxis' Java class
TimeAxis
jas2.plot

Class TimeAxis

  • All Implemented Interfaces:
    CoordinateTransformation, TimeCoordinateTransformation, java.io.Externalizable, java.io.Serializable


    public final class TimeAxis
    extends AxisType
    implements TimeCoordinateTransformation
    An axis type for representing times.

    Note that this is not the same as dates. A date represents a particular point in time (e.g., when an event took place). This axis represents time values, such as the time between two events. Therefore, while a date value may be represented as "Jan 31, 1994", a time value might be represented as "3 weeks".

    See Also:
    DateAxis, Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int DAYS
      The integer code for day units.
      static int HOURS
      The integer code for hour units.
      static int MILLISECONDS
      The integer code for millisecond units.
      static int MINUTES
      The integer code for minute units.
      static int MONTHS
      The integer code for month units.
      static long OMIT
      Set OMIT as the length of a time unit to have that unit not considered as a candidate for axis units.
      static int SECONDS
      The integer code for second units.
      static int WEEKS
      The integer code for week units.
      static int YEARS
      The integer code for year units.
    • Constructor Summary

      Constructors 
      Constructor and Description
      TimeAxis() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double convert(long time)
      Returns a pixel value for a time value.
      long getAxisMax()
      Returns the maximum value on the axis range.
      long getAxisMin()
      Returns the minimum value on the axis range.
      long getDataMax()
      Returns the maximum value on the axis range, as set by the method setMax(long).
      long getDataMin()
      Returns the minimum value on the data range, as set by the method setMin(long).
      long getUnitLength(int unit)
      Returns the number of milliseconds for this unit, or OMIT.
      java.lang.String getUnits()
      Returns a string representation of the units showing on the axis.
      void readExternal(java.io.ObjectInput in) 
      void setMax(long max)
      Sets the maximum value for the axis data.
      void setMin(long min)
      Sets the minimum value for the axis data.
      void setUnitLength(int unit, long length)
      Allows units to be viewed as valued different from the default.
      void setUseSuggestedRange(boolean useSuggestedRange)
      Sets whether this object should round the minimum down and the maximum up to make labels land exactly on the min and max of the axis range.
      void writeExternal(java.io.ObjectOutput out) 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MILLISECONDS

        public static final int MILLISECONDS
        The integer code for millisecond units.
        See Also:
        Constant Field Values
      • SECONDS

        public static final int SECONDS
        The integer code for second units.
        See Also:
        Constant Field Values
      • MINUTES

        public static final int MINUTES
        The integer code for minute units.
        See Also:
        Constant Field Values
      • MONTHS

        public static final int MONTHS
        The integer code for month units.
        See Also:
        Constant Field Values
      • OMIT

        public static final long OMIT
        Set OMIT as the length of a time unit to have that unit not considered as a candidate for axis units.
        See Also:
        Constant Field Values
    • Constructor Detail

      • TimeAxis

        public TimeAxis()
    • Method Detail

      • setUnitLength

        public void setUnitLength(int unit,
                                  long length)
        Allows units to be viewed as valued different from the default. For example, a year by default is 1000L * 60L * 60L * 24L * 365L milliseconds, but a call such as this may be desirable:
        setUnitLength(TimeAxis.YEARS, (long) (1000 * 60 * 60 * 24 * 365.24));
      • getUnitLength

        public long getUnitLength(int unit)
        Returns the number of milliseconds for this unit, or OMIT.
        See Also:
        OMIT
      • getUnits

        public java.lang.String getUnits()
        Returns a string representation of the units showing on the axis.
      • setUseSuggestedRange

        public void setUseSuggestedRange(boolean useSuggestedRange)
        Sets whether this object should round the minimum down and the maximum up to make labels land exactly on the min and max of the axis range.
      • setMin

        public void setMin(long min)
        Sets the minimum value for the axis data.
      • setMax

        public void setMax(long max)
        Sets the maximum value for the axis data.
      • getDataMin

        public long getDataMin()
        Returns the minimum value on the data range, as set by the method setMin(long). This value may be larger than the axis minimum if the axis has been told to use the suggested range.
        See Also:
        setMin(long), setUseSuggestedRange(boolean), getAxisMin()
      • getDataMax

        public long getDataMax()
        Returns the maximum value on the axis range, as set by the method setMax(long). This value may be smaller than the axis maximum if the axis has been told to use the suggested range.
        See Also:
        setMax(long), setUseSuggestedRange(boolean), getAxisMax()
      • writeExternal

        public void writeExternal(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.