Package org.openstreetmap.josm.data.gpx
Class GpxTimezone
- java.lang.Object
-
- org.openstreetmap.josm.data.gpx.GpxTimezone
-
public final class GpxTimezone extends java.lang.Object
Timezone in hours.TODO: should probably be replaced by
TimeZone.- Since:
- 14205 (extracted from
CorrelateGpxWithImages)
-
-
Field Summary
Fields Modifier and Type Field Description private doubletimezonestatic GpxTimezoneZEROThe timezone 0.
-
Constructor Summary
Constructors Constructor Description GpxTimezone(double hours)Constructs a newGpxTimezone.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.lang.StringformatTimezone()Formats time zone.doublegetHours()Returns the timezone in hours.inthashCode()static GpxTimezoneparseTimezone(java.lang.String timezone)Parses timezone.
-
-
-
Field Detail
-
ZERO
public static final GpxTimezone ZERO
The timezone 0.
-
timezone
private final double timezone
-
-
Constructor Detail
-
GpxTimezone
public GpxTimezone(double hours)
Constructs a newGpxTimezone.- Parameters:
hours- timezone in hours
-
-
Method Detail
-
getHours
public double getHours()
Returns the timezone in hours.- Returns:
- the timezone in hours
-
formatTimezone
public java.lang.String formatTimezone()
Formats time zone.- Returns:
- formatted time zone. Format: ±HH:MM
-
parseTimezone
public static GpxTimezone parseTimezone(java.lang.String timezone) throws java.text.ParseException
Parses timezone.- Parameters:
timezone- timezone. Expected format: ±HH:MM- Returns:
- timezone
- Throws:
java.text.ParseException- if timezone can't be parsed
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-