- java.lang.Object
-
- java.lang.Enum<DateTime.Granularity>
-
- com.pervasive.datarush.functions.DateTime.Granularity
-
- All Implemented Interfaces:
Serializable,Comparable<DateTime.Granularity>
- Enclosing class:
- DateTime
public static enum DateTime.Granularity extends Enum<DateTime.Granularity>
The desired granularity of the output.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CENTURYA unit of one centuryDAYA unit of one day.HOURA unit of one hour.MILLISECONDA unit of one millisecond.MINUTEA unit of one minute.MONTHA unit of one month.SECONDA unit of one second.WEEKA unit of one weekYEARA unit of one year.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetFactor()Gets the conversion factor from milliseconds.org.joda.time.DurationFieldTypegetField()Gets the equivalent Joda-Time field type.static DateTime.GranularityvalueOf(String name)Returns the enum constant of this type with the specified name.static DateTime.Granularity[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
MILLISECOND
public static final DateTime.Granularity MILLISECOND
A unit of one millisecond.
-
SECOND
public static final DateTime.Granularity SECOND
A unit of one second.
-
MINUTE
public static final DateTime.Granularity MINUTE
A unit of one minute.
-
HOUR
public static final DateTime.Granularity HOUR
A unit of one hour.
-
DAY
public static final DateTime.Granularity DAY
A unit of one day.
-
WEEK
public static final DateTime.Granularity WEEK
A unit of one week
-
MONTH
public static final DateTime.Granularity MONTH
A unit of one month.
-
YEAR
public static final DateTime.Granularity YEAR
A unit of one year.
-
CENTURY
public static final DateTime.Granularity CENTURY
A unit of one century
-
-
Method Detail
-
values
public static DateTime.Granularity[] 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 (DateTime.Granularity c : DateTime.Granularity.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DateTime.Granularity 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 nameNullPointerException- if the argument is null
-
getFactor
public double getFactor()
Gets the conversion factor from milliseconds.- Returns:
- the divisor to produce the specified granularity from milliseconds
-
getField
public org.joda.time.DurationFieldType getField()
Gets the equivalent Joda-Time field type.- Returns:
- the Joda-Time
DurationFieldTypefor this granularity
-
-