public final class GPSClock extends org.vesalainen.time.MutableClock implements NMEAClock
There are two modes depending on base clock.
Live (default). Data coming from active GPS. Time is updated between time-setting NMEA sentences to give accurate timing for other sentences as well.
Fixed (use fixed base clock). Data coming from recorded NMEA sentences like track file. Time is not updated between time-setting NMEA sentences.
| Constructor and Description |
|---|
GPSClock()
Creates a GPSClock in live mode using systemUTC base clock.
|
GPSClock(boolean live)
Creates a GPSClock in live or fixed mode depending on argument.
|
GPSClock(java.time.Clock clock)
Creates a GPSClock.
|
| Modifier and Type | Method and Description |
|---|---|
void |
commit(String reason) |
protected long |
getUpdated() |
boolean |
isCommitted()
returns true if committed ever
|
long |
offset()
Returns the offset in milliseconds between systemUTC time and this clock.
|
void |
rollback(String reason) |
void |
set(java.time.temporal.ChronoField chronoField,
int amount) |
void |
setZonedDateTime(java.time.ZonedDateTime zonedDateTime) |
void |
setZoneHours(int localZoneHours)
Sets Zone hour offset.
|
void |
setZoneMinutes(int localZoneMinutes)
Sets Zone minute offset.
|
void |
start(String reason) |
get, getLong, getZone, getZonedDateTime, instant, isSupported, millis, setMillis, toString, withZoneequals, fixed, hashCode, offset, system, systemDefaultZone, systemUTC, tick, tickMinutes, tickSecondsclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetZonedDateTime, millis, setMillischeckField, convertTo4DigitYear, equals, get, getDay, getGregorianCalendar, getHour, getMilliSecond, getMinute, getMonth, getOffsetSecond, getSecond, getYear, getZoneId, isAfter, isBefore, seconds, set, setDate, setDay, setHour, setMilliSecond, setMinute, setMonth, setOffsetSecond, setSecond, setTime, setYear, setZoneIdpublic GPSClock()
public GPSClock(boolean live)
live - public GPSClock(java.time.Clock clock)
It only matter if the clock is fixed or live. This clock always returns time according to GPS data. Live or recorded.
clock - Clock.fixed(java.time.Instant, java.time.ZoneId)public void start(String reason)
start in interface org.vesalainen.util.Transactionalpublic void commit(String reason)
commit in interface org.vesalainen.util.Transactionalpublic void rollback(String reason)
rollback in interface org.vesalainen.util.Transactionalprotected long getUpdated()
getUpdated in class org.vesalainen.time.MutableClockpublic void set(java.time.temporal.ChronoField chronoField,
int amount)
set in interface org.vesalainen.time.MutableDateTimeset in class org.vesalainen.time.MutableClockpublic void setZonedDateTime(java.time.ZonedDateTime zonedDateTime)
setZonedDateTime in interface org.vesalainen.time.MutableDateTimepublic void setZoneHours(int localZoneHours)
setZoneHours in interface NMEAClocklocalZoneHours - public void setZoneMinutes(int localZoneMinutes)
setZoneMinutes in interface NMEAClocklocalZoneMinutes - public boolean isCommitted()
NMEAClockisCommitted in interface NMEAClockCopyright © 2017. All rights reserved.