public class DateTickUnit extends TickUnit implements 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,
DateFormat formatter)
Creates a new date tick unit.
|
DateTickUnit(DateTickUnitType unitType,
int multiple,
DateTickUnitType rollUnitType,
int rollMultiple,
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,
DateFormat formatter)
Deprecated.
As of version 1.0.13, use
DateTickUnit(
DateTickUnitType, int, DateFormat) . |
DateTickUnit(int unit,
int count,
int rollUnit,
int rollCount,
DateFormat formatter)
Deprecated.
As of version 1.0.13, use
DateTickUnit(
DateTickUnitType, int, DateTickUnitType, int, DateFormat) . |
Modifier and Type | Method and Description |
---|---|
Date |
addToDate(Date base)
Deprecated.
As of JFreeChart 1.0.10, this method is deprecated - you
should use
addToDate(Date, TimeZone) instead. |
Date |
addToDate(Date base,
TimeZone zone)
Calculates a new date by adding this unit to the base date.
|
String |
dateToString(Date date)
Formats a date using the tick unit's formatter.
|
boolean |
equals(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.
|
Date |
rollDate(Date base)
Rolls the date forward by the amount specified by the roll unit and
count.
|
Date |
rollDate(Date base,
TimeZone zone)
Rolls the date forward by the amount specified by the roll unit and
count.
|
String |
toString()
Returns a string representation of this instance, primarily used for
debugging purposes.
|
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, 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, 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, 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, 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 String valueToString(double milliseconds)
valueToString
in class TickUnit
milliseconds
- date in milliseconds since 01-01-1970.public String dateToString(Date date)
date
- the date.public Date addToDate(Date base, TimeZone zone)
base
- the base date.zone
- the time zone for the date calculation.public Date rollDate(Date base)
base
- the base date.rollDate(Date, TimeZone)
public Date rollDate(Date base, TimeZone zone)
base
- the base date.zone
- the time zone.public int getCalendarField()
Calendar
class.public boolean equals(Object obj)
public int hashCode()
public String toString()
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 Date addToDate(Date base)
addToDate(Date, TimeZone)
instead.base
- the base date.addToDate(Date, TimeZone)
Jas4pp 1.5 © Java Analysis Studio for Particle Physics