java.lang.Object | ||
↳ | org.jfree.data.time.RegularTimePeriod | |
↳ | org.jfree.data.time.Hour |
Represents an hour in a specific day. This class is immutable, which is a
requirement for all RegularTimePeriod
subclasses.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | FIRST_HOUR_IN_DAY | Useful constant for the first hour in the day. | |||||||||
int | LAST_HOUR_IN_DAY | Useful constant for the last hour in the day. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new Hour, based on the system date/time.
| |||||||||||
Constructs a new Hour.
| |||||||||||
Creates a new hour.
| |||||||||||
Constructs a new instance, based on the supplied date/time and
the default time zone.
| |||||||||||
This constructor is deprecated.
As of 1.0.13, use the constructor that specifies the locale
also.
| |||||||||||
Constructs a new instance, based on the supplied date/time evaluated
in the specified time zone.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns an integer indicating the order of this Hour object relative to
the specified object:
negative == before, zero == same, positive == after.
| |||||||||||
Tests the equality of this object against an arbitrary Object.
| |||||||||||
Returns the day in which this hour falls.
| |||||||||||
Returns the day-of-the-month in which this hour falls.
| |||||||||||
Returns the first millisecond of the hour.
| |||||||||||
Returns the first millisecond of the hour.
| |||||||||||
Returns the hour.
| |||||||||||
Returns the last millisecond of the hour.
| |||||||||||
Returns the last millisecond of the hour.
| |||||||||||
Returns the month in which this hour falls.
| |||||||||||
Returns a serial index number for the hour.
| |||||||||||
Returns the year in which this hour falls.
| |||||||||||
Returns a hash code for this object instance.
| |||||||||||
Returns the hour following this one.
| |||||||||||
Creates an Hour instance by parsing a string.
| |||||||||||
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 hour preceding this one.
| |||||||||||
Returns a string representation of this instance, for debugging
purposes.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Useful constant for the first hour in the day.
Useful constant for the last hour in the day.
Constructs a new Hour, based on the system date/time.
Constructs a new Hour.
hour | the hour (in the range 0 to 23). |
---|---|
day | the day (null not permitted).
|
Creates a new hour.
hour | the hour (0-23). |
---|---|
day | the day (1-31). |
month | the month (1-12). |
year | the year (1900-9999). |
Constructs a new instance, based on the supplied date/time and the default time zone.
time | the date-time (null not permitted). |
---|
This constructor is deprecated.
As of 1.0.13, use the constructor that specifies the locale
also.
Constructs a new instance, based on the supplied date/time evaluated in the specified time zone.
time | the date-time (null not permitted). |
---|---|
zone | the time zone (null not permitted). |
Constructs a new instance, based on the supplied date/time evaluated in the specified time zone.
time | the date-time (null not permitted). |
---|---|
zone | the time zone (null not permitted). |
locale | the locale (null not permitted). |
Returns an integer indicating the order of this Hour object relative to the specified object: negative == before, zero == same, positive == after.
o1 | the object to compare. |
---|
Tests the equality of this object against an arbitrary Object.
This method will return true ONLY if the object is an Hour object representing the same hour as this instance.
obj | the object to compare (null permitted). |
---|
true
if the hour and day value of the object
is the same as this.
Returns the day-of-the-month in which this hour falls.
Returns the first millisecond of the hour.
calendar | the calendar/timezone (null not permitted). |
---|
NullPointerException | if calendar is
null .
|
---|
Returns the first millisecond of the hour. 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 hour.
Returns the last millisecond of the hour.
calendar | the calendar/timezone (null not permitted). |
---|
NullPointerException | if calendar is
null .
|
---|
Returns the last millisecond of the hour. 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 month in which this hour falls.
Returns a serial index number for the hour.
Returns the year in which this hour falls.
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 hour following this one.
Creates an Hour instance by parsing a string. The string is assumed to be in the format "YYYY-MM-DD HH", perhaps with leading or trailing whitespace.
s | the hour string to parse. |
---|
null
if the string is not parseable, the hour
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 hour preceding this one.
Returns a string representation of this instance, for debugging purposes.