|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.marineapi.nmea.util.Date
public class Date
Represents a calendar date (day-month-year) transmitted in sentences that
implement DateSentence
.
DateSentence
,
Time
Field Summary | |
---|---|
static int |
PIVOT_YEAR
A pivot value that is used to determine century for two-digit year values. |
Constructor Summary | |
---|---|
Date()
Creates a new instance of Date using the current date. |
|
Date(int year,
int month,
int day)
Constructor with date values. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
int |
getDay()
Get day of month. |
int |
getMonth()
Get month, valid values are 1-12 where 1 denotes January, 2 denotes February etc. |
int |
getYear()
Get year. |
int |
hashCode()
|
void |
setDay(int day)
Set day of month. |
void |
setMonth(int month)
Get month, valid values are 1-12 where 1 denotes January, 2 denotes February etc. |
void |
setYear(int year)
Set year. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int PIVOT_YEAR
Constructor Detail |
---|
public Date()
Date
using the current date.
public Date(int year, int month, int day)
year
- Year, two or four digit value [0..99] or [1000..9999]month
- Month [1..12]day
- Day [1..31]
IllegalArgumentException
- If any of the parameter is out of
bounds.Method Detail |
---|
public boolean equals(Object obj)
equals
in class Object
public int getDay()
public int getMonth()
public int getYear()
PIVOT_YEAR
. Values lower than or
equal to pivot are added to 2000, while values greater than pivot are
added to 1900.
PIVOT_YEAR
public int hashCode()
hashCode
in class Object
public void setDay(int day)
day
- the day to setpublic void setMonth(int month)
month
- the month to set
IllegalArgumentException
- If specified value is out of bounds
[1..12]public void setYear(int year)
year
- Year to set, two or four digit value.
IllegalArgumentException
- If specified value is negative or
three-digit value.public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |