Package com.tableau.hyperapi
Class Interval
- java.lang.Object
-
- com.tableau.hyperapi.Interval
-
-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Interval other)Compares this interval with the specified interval for order.booleanequals(java.lang.Object that)Checks two intervals for equality.intgetDays()Gets the days.intgetHours()Gets the hours.intgetMicroseconds()Gets the microseconds.intgetMinutes()Gets the minutes.intgetMonths()Gets the months.intgetSeconds()Gets the seconds.intgetYears()Gets the years.inthashCode()Computes a hash code.java.lang.StringtoString()Gets a string representation that matches the ISO 8601 duration representation (https://en.wikipedia .org/wiki/ISO_8601#Durations).
-
-
-
Constructor Detail
-
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 Detail
-
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 java.lang.String toString()
Gets a string representation that matches the ISO 8601 duration representation (https://en.wikipedia .org/wiki/ISO_8601#Durations).- Overrides:
toStringin classjava.lang.Object- Returns:
- The ISO 8601 duration representation.
-
equals
public boolean equals(java.lang.Object that)
Checks two intervals for equality.- Overrides:
equalsin classjava.lang.Object- Parameters:
that- The other interval.- Returns:
- Whether the two intervals are equal.
-
hashCode
public int hashCode()
Computes a hash code.- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(Interval other)
Compares this interval with the specified interval for order.- Specified by:
compareToin interfacejava.lang.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.
-
-