org.apache.calcite.avatica.util

## Enum TimeUnitRange

- java.lang.Object
- - java.lang.Enum<TimeUnitRange>
  - - org.apache.calcite.avatica.util.TimeUnitRange

All Implemented Interfaces:
  Serializable, Comparable<TimeUnitRange>

    public enum TimeUnitRange
    extends 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).

### Enum Constant Summary

Enum Constants
Enum Constant and Description
`CENTURY`
`DAY`
`DAY_TO_HOUR`
`DAY_TO_MINUTE`
`DAY_TO_SECOND`
`DECADE`
`DOW`
`DOY`
`EPOCH`
`HOUR`
`HOUR_TO_MINUTE`
`HOUR_TO_SECOND`
`ISODOW`
`ISOYEAR`
`MICROSECOND`
`MILLENNIUM`
`MILLISECOND`
`MINUTE`
`MINUTE_TO_SECOND`
`MONTH`
`NANOSECOND`
`QUARTER`
`SECOND`
`WEEK`
`YEAR`
`YEAR_TO_MONTH`

### Field Summary

Fields
`TimeUnit` `endUnit`
`TimeUnit` `startUnit`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `monthly()` Whether this is in the YEAR-TO-MONTH family of intervals.
`static TimeUnitRange` `of(TimeUnit startUnit, TimeUnit endUnit)` Returns a `TimeUnitRange` with a given start and end unit.
`static TimeUnitRange` `valueOf(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.

### Methods inherited from class java.lang.Enum

`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

### 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

### 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(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:
  `IllegalArgumentException` - if this enum type has no constant with the specified name
  `NullPointerException` - if the argument is null

#### of

    public static TimeUnitRange of(TimeUnit startUnit,
                                   TimeUnit endUnit)

Returns a `TimeUnitRange` with a given start and end unit.

Parameters:
  `startUnit` - Start unit
  `endUnit` - End unit
Returns:
  Time unit range, or null if not valid

#### monthly

    public boolean monthly()

Whether this is in the YEAR-TO-MONTH family of intervals.