public class DateTickUnit extends TickUnit implements Serializable
DateAxis. Instances of this
class are immutable.| 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.
|
| Modifier and Type | Method and Description |
|---|---|
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 |
getMultiple()
Returns the unit multiple.
|
int |
getRollMultiple()
Returns the roll unit multiple.
|
DateTickUnitType |
getRollUnitType()
Returns the roll unit type.
|
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, getSizepublic 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 DateTickUnitType getUnitType()
null).public int getMultiple()
public DateTickUnitType getRollUnitType()
null).public int getRollMultiple()
public String valueToString(double milliseconds)
valueToString in class TickUnitmilliseconds - 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()
Copyright © 2001–2017 JFree.org. All rights reserved.