|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.marineapi.nmea.util.Time
public class Time
Represents a time of day in 24-hour clock, i.e. the UTC time used as default
in NMEA 0183. Transmitted by TimeSentence
.
TimeSentence
,
Date
Constructor Summary | |
---|---|
Time()
Creates a new instance of Time using the current system
time. |
|
Time(int hour,
int min,
double sec)
Creates a new instance of Time. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
int |
getHour()
Get the hour of day. |
long |
getMilliseconds()
Get time as milliseconds since beginning of day. |
int |
getMinutes()
Get the minute of hour. |
double |
getSeconds()
Get the second of minute. |
int |
hashCode()
|
void |
setHour(int hour)
Set the hour of day. |
void |
setMinutes(int minutes)
Set the minute of hour. |
void |
setSeconds(double seconds)
Set seconds of minute. |
void |
setTime(Date d)
Set the time values from specified Date . |
Date |
toDate(Date d)
Convert to Date . |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Time()
Time
using the current system
time.
public Time(int hour, int min, double sec)
hour
- Hour of daymin
- Minute of hoursec
- Second of minuteMethod Detail |
---|
public boolean equals(Object obj)
equals
in class Object
public int getHour()
public long getMilliseconds()
public int getMinutes()
public double getSeconds()
public int hashCode()
hashCode
in class Object
public void setHour(int hour)
hour
- the hour to set
IllegalArgumentException
- If hour value out of bounds 0..23public void setMinutes(int minutes)
minutes
- the minute to set
IllegalArgumentException
- If minutes value out of bounds 0..59public void setSeconds(double seconds)
seconds
- the seconds to set
IllegalArgumentException
- If seconds value out of bounds 0..59public void setTime(Date d)
Date
. The date
information of is ignored, only hours, minutes and seconds are relevant.
d
- Datepublic Date toDate(Date d)
Date
.
d
- Date that defines year, month and day for time.
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |