Class Interval
- java.lang.Object
-
- org.openstreetmap.josm.tools.date.Interval
-
public final class Interval extends java.lang.Object
A timespan defined by a start and end instant.
-
-
Constructor Summary
Constructors Constructor Description Interval(java.time.Instant start, java.time.Instant end)Constructs a newInterval
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.lang.Stringformat()Formats the interval of the given track as a human readable stringjava.time.InstantgetEnd()Returns end instant.java.time.InstantgetStart()Returns start instant.inthashCode()java.lang.StringtoString()Returns an ISO 8601 compatible string
-
-
-
Constructor Detail
-
Interval
public Interval(java.time.Instant start, java.time.Instant end)
Constructs a newInterval- Parameters:
start- start instantend- end instant
-
-
Method Detail
-
toString
public java.lang.String toString()
Returns an ISO 8601 compatible string- Overrides:
toStringin classjava.lang.Object- Returns:
- an ISO 8601 compatible string
-
format
public java.lang.String format()
Formats the interval of the given track as a human readable string- Returns:
- The interval as a string
-
getStart
public java.time.Instant getStart()
Returns start instant.- Returns:
- start instant
-
getEnd
public java.time.Instant getEnd()
Returns end instant.- Returns:
- end instant
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-