Package slash.navigation.columbus
Class ColumbusGpsFormat
java.lang.Object
- All Implemented Interfaces:
NavigationFormat<Wgs84Route>
- Direct Known Subclasses:
ColumbusFusionFormat,ColumbusGpsType1Format,ColumbusGpsType2Format
The base of all Columbus GPS formats.
- Author:
- Christian Pesch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Loggerprotected static final charprotected static final Stringprotected static final StringFields inherited from class slash.navigation.base.SimpleFormat
BEGIN_OF_LINE, END_OF_LINE, POSITION, WHITE_SPACEFields inherited from class slash.navigation.base.TextNavigationFormat
BYTE_ORDER_MARKFields inherited from class slash.navigation.base.BaseNavigationFormat
GENERATED_BY, UNLIMITED_MAXIMUM_POSITION_COUNT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CompactCalendarasDeviceLocalTime(CompactCalendar time, TimeZone timeZone) InvertsCompactCalendar.asUTCTimeInTimeZone(java.util.TimeZone), which storeslocal - offset(local)wherelocalis the file's wall clock read as UTC.protected static Stringcoordinate(String hemisphere) A coordinate field: a decimal number followed by its hemisphere letter, each captured.<P extends NavigationPosition>
Wgs84RoutecreateRoute(RouteCharacteristics characteristics, String name, List<P> positions) protected static StringA comma-terminated capturing field surrounded by optional whitespace/NUL padding.protected StringfillWithZeros(String string, int length) protected StringformatCommonPrefix(Wgs84Position position, int index) protected StringformatDate(CompactCalendar date) protected StringformatTag(Wgs84Position position) protected StringformatTime(CompactCalendar time) protected CompactCalendargetDeviceLocalTimeToWrite(Wgs84Position position) SharedgetTimeToWrite(slash.navigation.base.Wgs84Position)body for the formats that do convert device-local time to UTC on read (Type2, Fusion) — both inverted it identically, so it lives here once instead of twice.protected abstract Stringprotected abstract Patternprotected abstract Patternprotected RouteCharacteristicsprotected CompactCalendargetTimeToWrite(Wgs84Position position) The time to write for this position.protected abstract booleanhasValidFix(String line, Matcher matcher) protected booleanprotected booleanisPosition(String line) protected booleanisValidLine(String line) protected static StringA capturing field without a trailing separator (the last field of a line).protected StringlatitudeHemisphere(Wgs84Position position) protected StringlongitudeHemisphere(Wgs84Position position) protected Wgs84PositionparseCommonPosition(Matcher matcher, ParserContext<?> context, CompactCalendar dateAndTime, int descriptionGroup, boolean isTypeA) Parses the fields common to every Columbus line format (index, tag, date/time, latitude/longitude with hemisphere sign, height, speed, heading, description) and builds the position; format-specific fields (dop/pressure/temperature) are set by callers.protected CompactCalendarparseDateAndTime(String date, String time) protected StringparseDescription(String description, String index, WaypointType waypointType) protected WaypointTypeprotected StringremoveZeros(String string) protected voidwriteHeader(PrintWriter writer, Wgs84Route route) Methods inherited from class slash.navigation.base.SimpleLineBasedFormat
createRoute, getGarbleCount, getMaximumPositionCount, parsePosition, read, write, writeFooter, writePositionMethods inherited from class slash.navigation.base.SimpleFormat
isSupportsMultipleRoutes, isWritingRouteCharacteristicsMethods inherited from class slash.navigation.base.TextNavigationFormat
isValidStartDate, read, read, write, writeMethods inherited from class slash.navigation.base.BaseNavigationFormat
asDesc, asDesc, asDescription, asDescription, asName, asName, asRouteName, equals, getCreator, getMaximumFileNameLength, getMaximumRouteNameLength, hashCode, isSupportsReading, isSupportsWritingMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface slash.navigation.base.NavigationFormat
getName
-
Field Details
-
log
-
SEPARATOR
protected static final char SEPARATOR- See Also:
-
SPACE_OR_ZERO
- See Also:
-
VALID_TAG_VALUES
- See Also:
-
-
Constructor Details
-
ColumbusGpsFormat
public ColumbusGpsFormat()
-
-
Method Details
-
getExtension
-
getRouteCharacteristics
- Overrides:
getRouteCharacteristicsin classSimpleLineBasedFormat<Wgs84Route>
-
isValidLine
- Overrides:
isValidLinein classSimpleLineBasedFormat<Wgs84Route>
-
getLinePattern
-
isPosition
- Specified by:
isPositionin classSimpleLineBasedFormat<Wgs84Route>
-
hasValidFix
-
getHeaderPattern
-
isHeader
-
getHeader
-
parseDateAndTime
-
parseTag
-
removeZeros
-
fillWithZeros
-
formatDate
-
formatTime
-
field
A comma-terminated capturing field surrounded by optional whitespace/NUL padding. -
lastField
A capturing field without a trailing separator (the last field of a line). -
coordinate
A coordinate field: a decimal number followed by its hemisphere letter, each captured. -
asDeviceLocalTime
InvertsCompactCalendar.asUTCTimeInTimeZone(java.util.TimeZone), which storeslocal - offset(local)wherelocalis the file's wall clock read as UTC. Recoveringlocalfrom that needs the offset *at the local instant*, not at the UTC one: the two are an offset apart, so around a DST transition they differ and a single-steputc + offset(utc)lands an hour out. One refinement pass settles it everywhere except inside the fall-back hour, which the file cannot disambiguate anyway (it records no offset).
-