Package org.apache.calcite.avatica.util
Enum TimeUnitRange
- java.lang.Object
-
- java.lang.Enum<TimeUnitRange>
-
- org.apache.calcite.avatica.util.TimeUnitRange
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<TimeUnitRange>
public enum TimeUnitRange extends java.lang.Enum<TimeUnitRange>
A range of time units. The first is more significant than the other (e.g. year-to-day) or the same as the other (e.g. month).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classTimeUnitRange.Pair<E>Immutable pair of values of the same type.
-
Enum Constant Summary
Enum Constants Enum Constant Description CENTURYDAYDAY_TO_HOURDAY_TO_MINUTEDAY_TO_SECONDDECADEDOWDOYEPOCHHOURHOUR_TO_MINUTEHOUR_TO_SECONDISODOWISOYEARMICROSECONDMILLENNIUMMILLISECONDMINUTEMINUTE_TO_SECONDMONTHNANOSECONDQUARTERSECONDWEEKYEARYEAR_TO_MONTH
-
Field Summary
Fields Modifier and Type Field Description TimeUnitendUnitprivate static java.util.Map<TimeUnitRange.Pair<TimeUnit>,TimeUnitRange>MAPTimeUnitstartUnit
-
Constructor Summary
Constructors Modifier Constructor Description privateTimeUnitRange(TimeUnit startUnit, TimeUnit endUnit)Creates a TimeUnitRange.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.util.Map<TimeUnitRange.Pair<TimeUnit>,TimeUnitRange>createMap()booleanmonthly()Whether this is in the YEAR-TO-MONTH family of intervals.static TimeUnitRangeof(TimeUnit startUnit, TimeUnit endUnit)Returns aTimeUnitRangewith a given start and end unit.static TimeUnitRangevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static TimeUnitRange[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
YEAR
public static final TimeUnitRange YEAR
-
YEAR_TO_MONTH
public static final TimeUnitRange YEAR_TO_MONTH
-
MONTH
public static final TimeUnitRange MONTH
-
DAY
public static final TimeUnitRange DAY
-
DAY_TO_HOUR
public static final TimeUnitRange DAY_TO_HOUR
-
DAY_TO_MINUTE
public static final TimeUnitRange DAY_TO_MINUTE
-
DAY_TO_SECOND
public static final TimeUnitRange DAY_TO_SECOND
-
HOUR
public static final TimeUnitRange HOUR
-
HOUR_TO_MINUTE
public static final TimeUnitRange HOUR_TO_MINUTE
-
HOUR_TO_SECOND
public static final TimeUnitRange HOUR_TO_SECOND
-
MINUTE
public static final TimeUnitRange MINUTE
-
MINUTE_TO_SECOND
public static final TimeUnitRange MINUTE_TO_SECOND
-
SECOND
public static final TimeUnitRange SECOND
-
ISOYEAR
public static final TimeUnitRange ISOYEAR
-
QUARTER
public static final TimeUnitRange QUARTER
-
WEEK
public static final TimeUnitRange WEEK
-
MILLISECOND
public static final TimeUnitRange MILLISECOND
-
MICROSECOND
public static final TimeUnitRange MICROSECOND
-
NANOSECOND
public static final TimeUnitRange NANOSECOND
-
DOW
public static final TimeUnitRange DOW
-
ISODOW
public static final TimeUnitRange ISODOW
-
DOY
public static final TimeUnitRange DOY
-
EPOCH
public static final TimeUnitRange EPOCH
-
DECADE
public static final TimeUnitRange DECADE
-
CENTURY
public static final TimeUnitRange CENTURY
-
MILLENNIUM
public static final TimeUnitRange MILLENNIUM
-
-
Field Detail
-
startUnit
public final TimeUnit startUnit
-
endUnit
public final TimeUnit endUnit
-
MAP
private static final java.util.Map<TimeUnitRange.Pair<TimeUnit>,TimeUnitRange> MAP
-
-
Method Detail
-
values
public static TimeUnitRange[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TimeUnitRange c : TimeUnitRange.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TimeUnitRange valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
of
public static TimeUnitRange of(TimeUnit startUnit, TimeUnit endUnit)
Returns aTimeUnitRangewith a given start and end unit.- Parameters:
startUnit- Start unitendUnit- End unit- Returns:
- Time unit range, or null if not valid
-
createMap
private static java.util.Map<TimeUnitRange.Pair<TimeUnit>,TimeUnitRange> createMap()
-
monthly
public boolean monthly()
Whether this is in the YEAR-TO-MONTH family of intervals.
-
-