java.lang.Object | ||
↳ | org.jfree.data.time.RegularTimePeriod | |
↳ | org.jfree.data.time.Year |
Represents a year in the range -9999 to 9999. This class is immutable,
which is a requirement for all RegularTimePeriod
subclasses.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | MAXIMUM_YEAR | The maximum year value. | |||||||||
int | MINIMUM_YEAR | The minimum year value. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new
Year , based on the current system date/time. | |||||||||||
Creates a time period representing a single year.
| |||||||||||
Creates a new
Year , based on a particular instant in time,
using the default time zone. | |||||||||||
This constructor is deprecated.
Since 1.0.12, use
Year(Date, TimeZone, Locale)
instead.
| |||||||||||
Creates a new
Year instance, for the specified time zone
and locale. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns an integer indicating the order of this
Year object
relative to the specified object:
negative == before, zero == same, positive == after. | |||||||||||
Tests the equality of this
Year object to an arbitrary
object. | |||||||||||
Returns the first millisecond of the year, evaluated using the supplied
calendar (which determines the time zone).
| |||||||||||
Returns the first millisecond of the year.
| |||||||||||
Returns the last millisecond of the year, evaluated using the supplied
calendar (which determines the time zone).
| |||||||||||
Returns the last millisecond of the year.
| |||||||||||
Returns a serial index number for the year.
| |||||||||||
Returns the year.
| |||||||||||
Returns a hash code for this object instance.
| |||||||||||
Returns the year following this one.
| |||||||||||
Parses the string argument as a year.
| |||||||||||
Recalculates the start date/time and end date/time for this time period
relative to the supplied calendar (which incorporates a time zone).
| |||||||||||
Returns the year preceding this one.
| |||||||||||
Returns a string representing the year..
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
The maximum year value.
The minimum year value.
Creates a new Year
, based on the current system date/time.
Creates a time period representing a single year.
year | the year. |
---|
Creates a new Year
, based on a particular instant in time,
using the default time zone.
time | the time (null not permitted). |
---|
This constructor is deprecated.
Since 1.0.12, use Year(Date, TimeZone, Locale)
instead.
Constructs a year, based on a particular instant in time and a time zone.
time | the time (null not permitted). |
---|---|
zone | the time zone. |
Creates a new Year
instance, for the specified time zone
and locale.
time | the current time (null not permitted). |
---|---|
zone | the time zone. |
locale | the locale. |
Returns an integer indicating the order of this Year
object
relative to the specified object:
negative == before, zero == same, positive == after.
o1 | the object to compare. |
---|
Tests the equality of this Year
object to an arbitrary
object. Returns true
if the target is a Year
instance representing the same year as this object. In all other cases,
returns false
.
obj | the object (null permitted). |
---|
true
if the year of this and the object are the
same.
Returns the first millisecond of the year, evaluated using the supplied calendar (which determines the time zone).
calendar | the calendar (null not permitted). |
---|
NullPointerException | if calendar is
null .
|
---|
Returns the first millisecond of the year. This will be determined
relative to the time zone specified in the constructor, or in the
calendar instance passed in the most recent call to the
peg(Calendar)
method.
Returns the last millisecond of the year, evaluated using the supplied calendar (which determines the time zone).
calendar | the calendar (null not permitted). |
---|
NullPointerException | if calendar is
null .
|
---|
Returns the last millisecond of the year. This will be
determined relative to the time zone specified in the constructor, or
in the calendar instance passed in the most recent call to the
peg(Calendar)
method.
Returns a serial index number for the year.
The implementation simply returns the year number (e.g. 2002).
Returns the year.
Returns a hash code for this object instance. The approach described by Joshua Bloch in "Effective Java" has been used here:
http://developer.java.sun.com/developer/Books/effectivejava
/Chapter3.pdf
Returns the year following this one.
null
if the current
year is 9999).
Parses the string argument as a year.
The string format is YYYY.
s | a string representing the year. |
---|
null
if the string is not parseable, the year
otherwise.
Recalculates the start date/time and end date/time for this time period relative to the supplied calendar (which incorporates a time zone).
calendar | the calendar (null not permitted). |
---|
Returns the year preceding this one.
null
if the
current year is -9999).
Returns a string representing the year..