public class DateTickUnit extends TickUnit implements java.io.Serializable
DateAxis
. Instances of this
class are immutable.Modifier and Type | Field and Description |
---|---|
static int |
DAY
Deprecated.
As of version 1.0.13, use
DateTickUnitType instead. |
static int |
HOUR
Deprecated.
As of version 1.0.13, use
DateTickUnitType instead. |
static int |
MILLISECOND
Deprecated.
As of version 1.0.13, use
DateTickUnitType instead. |
static int |
MINUTE
Deprecated.
As of version 1.0.13, use
DateTickUnitType instead. |
static int |
MONTH
Deprecated.
As of version 1.0.13, use
DateTickUnitType instead. |
static int |
SECOND
Deprecated.
As of version 1.0.13, use
DateTickUnitType instead. |
static int |
YEAR
Deprecated.
As of version 1.0.13, use
DateTickUnitType instead. |
Constructor and Description |
---|
DateTickUnit(DateTickUnitType unitType,
int multiple)
Creates a new date tick unit.
|
DateTickUnit(DateTickUnitType unitType,
int multiple,
java.text.DateFormat formatter)
Creates a new date tick unit.
|
DateTickUnit(DateTickUnitType unitType,
int multiple,
DateTickUnitType rollUnitType,
int rollMultiple,
java.text.DateFormat formatter)
Creates a new unit.
|
DateTickUnit(int unit,
int count)
Deprecated.
As of version 1.0.13, use
DateTickUnit(
DateTickUnitType, int) . |
DateTickUnit(int unit,
int count,
java.text.DateFormat formatter)
Deprecated.
As of version 1.0.13, use
DateTickUnit(
DateTickUnitType, int, DateFormat) . |
DateTickUnit(int unit,
int count,
int rollUnit,
int rollCount,
java.text.DateFormat formatter)
Deprecated.
As of version 1.0.13, use
DateTickUnit(
DateTickUnitType, int, DateTickUnitType, int, DateFormat) . |
Modifier and Type | Method and Description |
---|---|
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()
Deprecated.
As of version 1.0.13, use
getMultiple() . |
int |
getMultiple()
Returns the unit multiple.
|
int |
getRollCount()
Deprecated.
As of version 1.0.13, use the
getRollMultiple() |
int |
getRollMultiple()
Returns the roll unit multiple.
|
int |
getRollUnit()
Deprecated.
As of version 1.0.13, use
getRollUnitType() . |
DateTickUnitType |
getRollUnitType()
Returns the roll unit type.
|
int |
getUnit()
Deprecated.
As of 1.0.13, use the getUnitType() method.
|
DateTickUnitType |
getUnitType()
Returns the unit type.
|
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.
|
compareTo, getMinorTickCount, getSize
public static final int YEAR
DateTickUnitType
instead.public static final int MONTH
DateTickUnitType
instead.public static final int DAY
DateTickUnitType
instead.public static final int HOUR
DateTickUnitType
instead.public static final int MINUTE
DateTickUnitType
instead.public static final int SECOND
DateTickUnitType
instead.public static final int MILLISECOND
DateTickUnitType
instead.public DateTickUnit(DateTickUnitType unitType, int multiple)
unitType
- the unit type (null
not permitted).multiple
- the multiple (of the unit type, must be > 0).public DateTickUnit(DateTickUnitType unitType, int multiple, java.text.DateFormat formatter)
unitType
- the unit type (null
not permitted).multiple
- the multiple (of the unit type, must be > 0).formatter
- the date formatter (null
not permitted).public DateTickUnit(DateTickUnitType unitType, int multiple, DateTickUnitType rollUnitType, int rollMultiple, java.text.DateFormat formatter)
unitType
- the unit.multiple
- the multiple.rollUnitType
- the roll unit.rollMultiple
- the roll multiple.formatter
- the date formatter (null
not permitted).public DateTickUnit(int unit, int count, java.text.DateFormat formatter)
DateTickUnit(
DateTickUnitType, int, DateFormat)
.unit
- the unit.count
- the unit count.formatter
- the date formatter (defaults to DateFormat.SHORT).public DateTickUnit(int unit, int count)
DateTickUnit(
DateTickUnitType, int)
.unit
- the unit.count
- the unit count.public DateTickUnit(int unit, int count, int rollUnit, int rollCount, java.text.DateFormat formatter)
DateTickUnit(
DateTickUnitType, int, DateTickUnitType, int, DateFormat)
.unit
- the unit.count
- the count.rollUnit
- the roll unit.rollCount
- the roll count.formatter
- the date formatter (defaults to DateFormat.SHORT).public DateTickUnitType getUnitType()
null
).public int getMultiple()
public DateTickUnitType getRollUnitType()
null
).public int getRollMultiple()
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, 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)
public int hashCode()
public java.lang.String toString()
toString
in class java.lang.Object
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()
getMultiple()
.public int getRollUnit()
getRollUnitType()
.public int getRollCount()
getRollMultiple()
public java.util.Date addToDate(java.util.Date base)
addToDate(Date, TimeZone)
instead.base
- the base date.addToDate(Date, TimeZone)