|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.degreedays.time.StartOfMonth
public final class StartOfMonth
Specifies a definition of "months" that begin on a specified day of the month (e.g. 1 for calendar months).
Instances of this class are immutable. You can safely reuse them and call them from multiple threads at once.
Constructor Summary | |
---|---|
StartOfMonth(int dayOfMonth)
Constructs a StartOfMonth object specifying a definition of
"months" that begin on the specified day of the month. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object anotherStartOfMonth)
|
int |
dayOfMonth()
Returns a number between 1 and 28 (inclusive) indicating which day should be taken as the first of the month. |
boolean |
equals(java.lang.Object o)
Returns true if o is a StartOfMonth
object representing the same day in the month as this ;
false otherwise. |
static StartOfMonth |
fromString(java.lang.String startOfMonthString)
Parses a string representation of a StartOfMonth in
---DD format, the format used by XML Schema's gDay type
(based on ISO 8601). |
int |
hashCode()
Overridden to ensure consistency with equals . |
static StartOfMonth |
of(int dayOfMonth)
Returns a non-null StartOfMonth object specifying a
definition of "months" that begin on the specified day of the month. |
java.lang.String |
toString()
Returns a non-null, non-empty string representation of this object in ---DD format, the format used by XML Schema's gDay type
(based on ISO 8601). |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StartOfMonth(int dayOfMonth)
StartOfMonth
object specifying a definition of
"months" that begin on the specified day of the month.
dayOfMonth
- a number between 1 and 28 (inclusive) indicating which
day should be taken as the start of the "month". Pass 1 to specify
regular calendar months.
java.lang.IllegalArgumentException
- if dayOfMonth
is less than
1 or greater than 28.Method Detail |
---|
public static StartOfMonth of(int dayOfMonth)
StartOfMonth
object specifying a
definition of "months" that begin on the specified day of the month.
dayOfMonth
- a number between 1 and 28 (inclusive) indicating which
day should be taken as the start of the "month". Pass 1 to specify
regular calendar months.
java.lang.IllegalArgumentException
- if dayOfMonth
is less than
1 or greater than 28.public int dayOfMonth()
public static StartOfMonth fromString(java.lang.String startOfMonthString) throws java.lang.NumberFormatException
StartOfMonth
in
---DD
format, the format used by XML Schema's gDay type
(based on ISO 8601).
Note that, since StartOfMonth
is designed to be applicable
to all months of all years, this method will not accept
"---29"
, "---30"
, or "---31"
.
startOfMonthString
- a string with format ---DD
, where
DD
is a number between 01 and 28 (inclusive).
StartOfMonth
object corresponding to the
day of the month represented by startOfMonthString
.
java.lang.NullPointerException
- if startOfMonthString
is
null
.
java.lang.NumberFormatException
- if startOfMonthString
has an
invalid format, or represents an day of the month that is greater
than 28.public java.lang.String toString()
---DD
format, the format used by XML Schema's gDay type
(based on ISO 8601).
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
true
if o
is a StartOfMonth
object representing the same day in the month as this
;
false
otherwise.
equals
in class java.lang.Object
public int hashCode()
equals
.
hashCode
in class java.lang.Object
public int compareTo(java.lang.Object anotherStartOfMonth)
compareTo
in interface java.lang.Comparable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |