|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jcoderz.commons.types.YearMonth
public final class YearMonth
Encapsulates the Year Month type. Instances of this class are immutable. Years before 1 are not fully supported and might result in wrong string representations. Not parseable time zones might be ignored.
| Field Summary | |
|---|---|
static int |
MINIMUM_NUMBER_OF_YEAR_DIGITS
Minimum length for the year. |
static int |
MONTH_LENGTH
Fixed length for the month. |
static String |
TYPE_NAME
The name of this type. |
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
static YearMonth |
fromString(String str)
Parses a valid XML representation of the gYearMonth type. |
int |
getMonth()
Returns the month counting from 1 (January) to 12 (December). |
int |
getYear()
|
int |
hashCode()
|
boolean |
isWithin(Date date)
Returns true if the given date is within this year/month. |
Date |
toEndDate()
Returns the valid date that represents the end of the month year type. |
Period |
toPeriod()
Returns this as period from start date to end date of this YearMonth. |
Date |
toStartDate()
Returns the valid date that represents the beginning of the month year type. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String TYPE_NAME
public static final int MINIMUM_NUMBER_OF_YEAR_DIGITS
public static final int MONTH_LENGTH
| Method Detail |
|---|
public static YearMonth fromString(String str)
str - the string representing the year month.
public Date toStartDate()
public Date toEndDate()
public Period toPeriod()
public int getMonth()
public int getYear()
public boolean isWithin(Date date)
date - the point in time to check.
public String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object o)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||