Class Interval

java.lang.Object
com.tableau.hyperapi.Interval
All Implemented Interfaces:
Comparable<Interval>

public final class Interval extends Object implements Comparable<Interval>
An interval data type.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Interval(int years, int months, int days, int hours, int minutes, int seconds, int microseconds)
    Creates an interval value from a number of years, months, days, hours, minutes, seconds, and microseconds.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Compares this interval with the specified interval for order.
    boolean
    equals(Object that)
    Checks two intervals for equality.
    int
    Gets the days.
    int
    Gets the hours.
    int
    Gets the microseconds.
    int
    Gets the minutes.
    int
    Gets the months.
    int
    Gets the seconds.
    int
    Gets the years.
    int
    Computes a hash code.
    Gets a string representation that matches the ISO 8601 duration representation (https://en.wikipedia .org/wiki/ISO_8601#Durations).

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Interval

      public Interval(int years, int months, int days, int hours, int minutes, int seconds, int microseconds)
      Creates an interval value from a number of years, months, days, hours, minutes, seconds, and microseconds.
      Parameters:
      years - The years.
      months - The months.
      days - The days.
      hours - The hours.
      minutes - The minutes.
      seconds - The seconds.
      microseconds - The microseconds.
      Throws:
      HyperException - If column is not defined as HYPER_Interval.
  • Method Details

    • getYears

      public int getYears()
      Gets the years.
      Returns:
      The years.
    • getMonths

      public int getMonths()
      Gets the months.
      Returns:
      The months.
    • getDays

      public int getDays()
      Gets the days.
      Returns:
      The days.
    • getHours

      public int getHours()
      Gets the hours.
      Returns:
      The hours.
    • getMinutes

      public int getMinutes()
      Gets the minutes.
      Returns:
      The minutes.
    • getSeconds

      public int getSeconds()
      Gets the seconds.
      Returns:
      The seconds.
    • getMicroseconds

      public int getMicroseconds()
      Gets the microseconds.
      Returns:
      The microseconds.
    • toString

      public String toString()
      Gets a string representation that matches the ISO 8601 duration representation (https://en.wikipedia .org/wiki/ISO_8601#Durations).
      Overrides:
      toString in class Object
      Returns:
      The ISO 8601 duration representation.
    • equals

      public boolean equals(Object that)
      Checks two intervals for equality.
      Overrides:
      equals in class Object
      Parameters:
      that - The other interval.
      Returns:
      Whether the two intervals are equal.
    • hashCode

      public int hashCode()
      Computes a hash code.
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(Interval other)
      Compares this interval with the specified interval for order.
      Specified by:
      compareTo in interface Comparable<Interval>
      Parameters:
      other - The other interval.
      Returns:
      A negative integer, zero, or a positive integer as this interval is less than, equal to, or greater than the other interval.