Class Interval


  • public final class Interval
    extends java.lang.Object
    A timespan defined by a start and end instant.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.time.Instant end  
      private java.time.Instant start  
    • Constructor Summary

      Constructors 
      Constructor Description
      Interval​(java.time.Instant start, java.time.Instant end)
      Constructs a new Interval
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.String format()
      Formats the interval of the given track as a human readable string
      java.time.Instant getEnd()
      Returns end instant.
      java.time.Instant getStart()
      Returns start instant.
      int hashCode()  
      java.lang.String toString()
      Returns an ISO 8601 compatible string
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • start

        private final java.time.Instant start
      • end

        private final java.time.Instant end
    • Constructor Detail

      • Interval

        public Interval​(java.time.Instant start,
                        java.time.Instant end)
        Constructs a new Interval
        Parameters:
        start - start instant
        end - end instant
    • Method Detail

      • toString

        public java.lang.String toString()
        Returns an ISO 8601 compatible string
        Overrides:
        toString in class java.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:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object