Package com.tableau.hyperapi
Class Interval
java.lang.Object
com.tableau.hyperapi.Interval
- All Implemented Interfaces:
Comparable<Interval>
An interval data type.
-
Constructor Summary
ConstructorDescriptionInterval
(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 TypeMethodDescriptionint
Compares this interval with the specified interval for order.boolean
Checks two intervals for equality.int
getDays()
Gets the days.int
getHours()
Gets the hours.int
Gets the microseconds.int
Gets the minutes.int
Gets the months.int
Gets the seconds.int
getYears()
Gets the years.int
hashCode()
Computes a hash code.toString()
Gets a string representation that matches the ISO 8601 duration representation (https://en.wikipedia .org/wiki/ISO_8601#Durations).
-
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
Gets a string representation that matches the ISO 8601 duration representation (https://en.wikipedia .org/wiki/ISO_8601#Durations). -
equals
Checks two intervals for equality. -
hashCode
public int hashCode()Computes a hash code. -
compareTo
Compares this interval with the specified interval for order.- Specified by:
compareTo
in interfaceComparable<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.
-