org.jfree.chart.axis
public class DateTickUnit extends TickUnit implements Serializable
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(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, DateFormat formatter)
Creates a new date tick unit. | |
DateTickUnit(int unit, int count)
Creates a new date tick unit. | |
DateTickUnit(int unit, int count, int rollUnit, int rollCount, DateFormat formatter)
Creates a new unit.
|
Method Summary | |
---|---|
Date | addToDate(Date base, TimeZone zone)
Calculates a new date by adding this unit to the base date.
|
Date | addToDate(Date base)
Calculates a new date by adding this unit to the base date, with
calculations performed in the default timezone and locale.
|
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()
Returns the unit count.
|
int | getMultiple()
Returns the unit multiple.
|
int | getRollCount()
Returns the roll count.
|
int | getRollMultiple()
Returns the roll unit multiple.
|
int | getRollUnit()
Returns the roll unit. |
DateTickUnitType | getRollUnitType()
Returns the roll unit type.
|
int | getUnit()
Returns the date unit. |
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.
|
Deprecated: As of version 1.0.13, use DateTickUnitType instead.
A constant for days.Deprecated: As of version 1.0.13, use DateTickUnitType instead.
A constant for hours.Deprecated: As of version 1.0.13, use DateTickUnitType instead.
A constant for milliseconds.Deprecated: As of version 1.0.13, use DateTickUnitType instead.
A constant for minutes.Deprecated: As of version 1.0.13, use DateTickUnitType instead.
A constant for months.Deprecated: As of version 1.0.13, use DateTickUnitType instead.
A constant for seconds.Deprecated: As of version 1.0.13, use DateTickUnitType instead.
A constant for years.Parameters: unitType the unit type (null
not permitted). multiple the multiple (of the unit type, must be > 0).
Since: 1.0.13
Parameters: unitType the unit type (null
not permitted). multiple the multiple (of the unit type, must be > 0). formatter the date formatter (null
not permitted).
Since: 1.0.13
Parameters: unitType the unit. multiple the multiple. rollUnitType the roll unit. rollMultiple the roll multiple. formatter the date formatter (null
not permitted).
Since: 1.0.13
Deprecated: As of version 1.0.13, use DateTickUnit.
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. count the unit count. formatter the date formatter (defaults to DateFormat.SHORT).
Deprecated: As of version 1.0.13, use DateTickUnit.
Creates a new date tick unit. The dates will be formatted using a SHORT format for the default locale.Parameters: unit the unit. count the unit count.
Deprecated: As of version 1.0.13, use DateTickUnit.
Creates a new unit.Parameters: unit the unit. count the count. rollUnit the roll unit. rollCount the roll count. formatter the date formatter (defaults to DateFormat.SHORT).
Parameters: base the base date. zone the time zone for the date calculation.
Returns: A new date one unit after the base date.
Since: 1.0.6
Deprecated: As of JFreeChart 1.0.10, this method is deprecated - you should use DateTickUnit instead.
Calculates a new date by adding this unit to the base date, with calculations performed in the default timezone and locale.Parameters: base the base date.
Returns: A new date one unit after the base date.
Parameters: date the date.
Returns: The formatted date.
Parameters: obj the object (null
permitted).
Returns: true
or false
.
Calendar
class.
Returns: The field code.
Deprecated: As of version 1.0.13, use getMultiple.
Returns the unit count.Returns: The unit count.
Returns: The unit multiple (always > 0).
Deprecated: As of version 1.0.13, use the getRollMultiple
Returns the roll count.Returns: The roll count.
Returns: The roll unit multiple.
Since: 1.0.13
Deprecated: As of version 1.0.13, use getRollUnitType.
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).Returns: The roll unit.
Returns: The roll unit type (never null
).
Since: 1.0.13
Deprecated: As of 1.0.13, use the getUnitType() method.
Returns the date unit. This will be one of the constantsYEAR
, 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.
Returns: The date unit.
Returns: The unit type (never null
).
Since: 1.0.13
Returns: A hash code.
Parameters: base the base date.
Returns: The rolled date.
See Also: DateTickUnit
Parameters: base the base date. zone the time zone.
Returns: The rolled date.
Since: 1.0.6
Returns: A string representation of this instance.
Parameters: milliseconds date in milliseconds since 01-01-1970.
Returns: The formatted date.