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 double
timezone
static GpxTimezone
ZERO
The 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 boolean
equals(java.lang.Object o)
java.lang.String
formatTimezone()
Formats time zone.double
getHours()
Returns the timezone in hours.int
hashCode()
static GpxTimezone
parseTimezone(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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-