| java.lang.Object org.jfree.chart.axis.TickUnit org.jfree.chart.axis.DateTickUnit
DateTickUnit | public class DateTickUnit extends TickUnit implements Serializable(Code) | | A tick unit for use by subclasses of
DateAxis . Instances of this
class are immutable.
|
Field Summary | |
final public static int | DAY A constant for days. | final public static int | HOUR A constant for hours. | final public static int | MILLISECOND A constant for milliseconds. | final public static int | MINUTE A constant for minutes. | final public static int | MONTH A constant for months. | final public static int | SECOND A constant for seconds. | final public static int | YEAR A constant for years. |
Constructor Summary | |
public | DateTickUnit(int unit, int count) Creates a new date tick unit. | public | DateTickUnit(int unit, int count, DateFormat formatter) Creates a new date tick unit. | public | DateTickUnit(int unit, int count, int rollUnit, int rollCount, DateFormat formatter) Creates a new unit. |
Method Summary | |
public Date | addToDate(Date base) Calculates a new date by adding this unit to the base date.
Parameters: base - the base date. | public Date | addToDate(Date base, TimeZone zone) Calculates a new date by adding this unit to the base date.
Parameters: base - the base date. Parameters: zone - the time zone for the date calculation. | public String | dateToString(Date date) Formats a date using the tick unit's formatter.
Parameters: date - the date. | public boolean | equals(Object obj) Tests this unit for equality with another object.
Parameters: obj - the object (null permitted). | public int | getCalendarField() Returns a field code that can be used with the Calendar
class. | public int | getCount() Returns the unit count. | public int | getRollCount() Returns the roll count. | public int | getRollUnit() Returns the roll unit. | public int | getUnit() Returns the date unit. | public int | hashCode() Returns a hash code for this object. | public Date | rollDate(Date base) Rolls the date forward by the amount specified by the roll unit and
count.
Parameters: base - the base date. | public Date | rollDate(Date base, TimeZone zone) Rolls the date forward by the amount specified by the roll unit and
count.
Parameters: base - the base date. Parameters: zone - the time zone. | public String | toString() Returns a string representation of this instance, primarily used for
debugging purposes. | public String | valueToString(double milliseconds) Formats a value.
Parameters: milliseconds - date in milliseconds since 01-01-1970. |
DAY | final public static int DAY(Code) | | A constant for days.
|
HOUR | final public static int HOUR(Code) | | A constant for hours.
|
MILLISECOND | final public static int MILLISECOND(Code) | | A constant for milliseconds.
|
MINUTE | final public static int MINUTE(Code) | | A constant for minutes.
|
MONTH | final public static int MONTH(Code) | | A constant for months.
|
SECOND | final public static int SECOND(Code) | | A constant for seconds.
|
YEAR | final public static int YEAR(Code) | | A constant for years.
|
DateTickUnit | public DateTickUnit(int unit, int count)(Code) | | Creates a new date tick unit. The dates will be formatted using a
SHORT format for the default locale.
Parameters: unit - the unit. Parameters: count - the unit count. |
DateTickUnit | public DateTickUnit(int unit, int count, DateFormat formatter)(Code) | | Creates a new date tick unit. You can specify the units using one of
the constants YEAR, MONTH, DAY, HOUR, MINUTE, SECOND or MILLISECOND.
In addition, you can specify a unit count, and a date format.
Parameters: unit - the unit. Parameters: count - the unit count. Parameters: formatter - the date formatter (defaults to DateFormat.SHORT). |
DateTickUnit | public DateTickUnit(int unit, int count, int rollUnit, int rollCount, DateFormat formatter)(Code) | | Creates a new unit.
Parameters: unit - the unit. Parameters: count - the count. Parameters: rollUnit - the roll unit. Parameters: rollCount - the roll count. Parameters: formatter - the date formatter (defaults to DateFormat.SHORT). |
addToDate | public Date addToDate(Date base, TimeZone zone)(Code) | | Calculates a new date by adding this unit to the base date.
Parameters: base - the base date. Parameters: zone - the time zone for the date calculation. A new date one unit after the base date. since: 1.0.6 See Also: DateTickUnit.addToDate(Date) |
dateToString | public String dateToString(Date date)(Code) | | Formats a date using the tick unit's formatter.
Parameters: date - the date. The formatted date. |
equals | public boolean equals(Object obj)(Code) | | Tests this unit for equality with another object.
Parameters: obj - the object (null permitted). true or false . |
getCalendarField | public int getCalendarField()(Code) | | Returns a field code that can be used with the Calendar
class.
The field code. |
getCount | public int getCount()(Code) | | Returns the unit count.
The unit count. |
getRollCount | public int getRollCount()(Code) | | Returns the roll count.
The roll count. |
getRollUnit | public int getRollUnit()(Code) | | Returns the roll unit. This is the amount by which the tick advances if
it is "hidden" when displayed on a segmented date axis. Typically the
roll will be smaller than the regular tick unit (for example, a 7 day
tick unit might use a 1 day roll).
The roll unit. |
getUnit | public int getUnit()(Code) | | Returns the date unit. This will be one of the constants
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.
The date unit. |
hashCode | public int hashCode()(Code) | | Returns a hash code for this object.
A hash code. |
rollDate | public Date rollDate(Date base, TimeZone zone)(Code) | | Rolls the date forward by the amount specified by the roll unit and
count.
Parameters: base - the base date. Parameters: zone - the time zone. The rolled date. since: 1.0.6 See Also: DateTickUnit.rollDate(Date) |
toString | public String toString()(Code) | | Returns a string representation of this instance, primarily used for
debugging purposes.
A string representation of this instance. |
valueToString | public String valueToString(double milliseconds)(Code) | | Formats a value.
Parameters: milliseconds - date in milliseconds since 01-01-1970. The formatted date. |
|
|