public class YearMonth extends Object implements Serializable
Constructor and Description |
---|
YearMonth(int year,
int month)
Constructs a YearMonth with the given values
No timezone is specified
|
YearMonth(int year,
int month,
String timezone)
Constructs a YearMonth with the given values, including a timezone string
The timezone is validated but not used.
|
YearMonth(String source)
Construct a YearMonth from a String in the format [-]CCYY-MM
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
getMonth() |
String |
getTimezone() |
int |
getYear() |
int |
hashCode()
Return the value of (month + year) XORed with the hashCode of
timezone iff one is defined.
|
void |
setMonth(int month) |
void |
setTimezone(String timezone) |
void |
setValue(int year,
int month) |
void |
setValue(int year,
int month,
String timezone) |
void |
setYear(int year) |
String |
toString() |
public YearMonth(int year, int month) throws NumberFormatException
NumberFormatException
public YearMonth(int year, int month, String timezone) throws NumberFormatException
NumberFormatException
public YearMonth(String source) throws NumberFormatException
NumberFormatException
public int getYear()
public void setYear(int year)
public int getMonth()
public void setMonth(int month)
public String getTimezone()
public void setTimezone(String timezone)
public void setValue(int year, int month, String timezone) throws NumberFormatException
NumberFormatException
public void setValue(int year, int month) throws NumberFormatException
NumberFormatException
Copyright © The Apache Software Foundation. All Rights Reserved.