- 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 CENTURY
A unit of one centuryDAY
A unit of one day.HOUR
A unit of one hour.MILLISECOND
A unit of one millisecond.MINUTE
A unit of one minute.MONTH
A unit of one month.SECOND
A unit of one second.WEEK
A unit of one weekYEAR
A unit of one year.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getFactor()
Gets the conversion factor from milliseconds.org.joda.time.DurationFieldType
getField()
Gets the equivalent Joda-Time field type.static DateTime.Granularity
valueOf(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
DurationFieldType
for this granularity
-
-