|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.chart.axis.TickUnit
org.jfree.chart.axis.DateTickUnit
public class DateTickUnit
A tick unit for use by subclasses of DateAxis
. Instances of this
class are immutable.
Field Summary | |
---|---|
static int |
DAY
A constant for days. |
static int |
HOUR
A constant for hours. |
static int |
MILLISECOND
A constant for milliseconds. |
static int |
MINUTE
A constant for minutes. |
static int |
MONTH
A constant for months. |
static int |
SECOND
A constant for seconds. |
static int |
YEAR
A constant for years. |
Constructor Summary | |
---|---|
DateTickUnit(int unit,
int count)
Creates a new date tick unit. |
|
DateTickUnit(int unit,
int count,
java.text.DateFormat formatter)
Creates a new date tick unit. |
|
DateTickUnit(int unit,
int count,
int rollUnit,
int rollCount,
java.text.DateFormat formatter)
Creates a new unit. |
Method Summary | |
---|---|
java.util.Date |
addToDate(java.util.Date base)
Deprecated. As of JFreeChart 1.0.10, this method is deprecated - you should use addToDate(Date, TimeZone) instead. |
java.util.Date |
addToDate(java.util.Date base,
java.util.TimeZone zone)
Calculates a new date by adding this unit to the base date. |
java.lang.String |
dateToString(java.util.Date date)
Formats a date using the tick unit's formatter. |
boolean |
equals(java.lang.Object obj)
Tests this unit for equality with another object. |
int |
getCalendarField()
Returns a field code that can be used with the Calendar
class. |
int |
getCount()
Returns the unit count. |
int |
getRollCount()
Returns the roll count. |
int |
getRollUnit()
Returns the roll unit. |
int |
getUnit()
Returns the date unit. |
int |
hashCode()
Returns a hash code for this object. |
java.util.Date |
rollDate(java.util.Date base)
Rolls the date forward by the amount specified by the roll unit and count. |
java.util.Date |
rollDate(java.util.Date base,
java.util.TimeZone zone)
Rolls the date forward by the amount specified by the roll unit and count. |
java.lang.String |
toString()
Returns a string representation of this instance, primarily used for debugging purposes. |
java.lang.String |
valueToString(double milliseconds)
Formats a value. |
Methods inherited from class org.jfree.chart.axis.TickUnit |
---|
compareTo, getMinorTickCount, getSize |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int YEAR
public static final int MONTH
public static final int DAY
public static final int HOUR
public static final int MINUTE
public static final int SECOND
public static final int MILLISECOND
Constructor Detail |
---|
public DateTickUnit(int unit, int count)
unit
- the unit.count
- the unit count.public DateTickUnit(int unit, int count, java.text.DateFormat formatter)
unit
- the unit.count
- the unit count.formatter
- the date formatter (defaults to DateFormat.SHORT).public DateTickUnit(int unit, int count, int rollUnit, int rollCount, java.text.DateFormat formatter)
unit
- the unit.count
- the count.rollUnit
- the roll unit.rollCount
- the roll count.formatter
- the date formatter (defaults to DateFormat.SHORT).Method Detail |
---|
public int getUnit()
YEAR
, MONTH
, DAY
,
HOUR
, MINUTE
, SECOND
or
MILLISECOND
, defined by this class. Note that these
constants do NOT correspond to those defined in Java's
Calendar
class.
public int getCount()
public int getRollUnit()
public int getRollCount()
public java.lang.String valueToString(double milliseconds)
valueToString
in class TickUnit
milliseconds
- date in milliseconds since 01-01-1970.
public java.lang.String dateToString(java.util.Date date)
date
- the date.
public java.util.Date addToDate(java.util.Date base)
addToDate(Date, TimeZone)
instead.
base
- the base date.
addToDate(Date, TimeZone)
public java.util.Date addToDate(java.util.Date base, java.util.TimeZone zone)
base
- the base date.zone
- the time zone for the date calculation.
public java.util.Date rollDate(java.util.Date base)
base
- the base date.
rollDate(Date, TimeZone)
public java.util.Date rollDate(java.util.Date base, java.util.TimeZone zone)
base
- the base date.zone
- the time zone.
public int getCalendarField()
Calendar
class.
public boolean equals(java.lang.Object obj)
equals
in class TickUnit
obj
- the object (null
permitted).
true
or false
.public int hashCode()
hashCode
in class TickUnit
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |