public static enum Utils.Granularity extends Enum<Utils.Granularity>
Modifier and Type | Method and Description |
---|---|
static Utils.Granularity |
fromMillis(long millis) |
int |
getBinId(long timeMillis)
Bin id for an epoch time is the epoch time in the corresponding granularity.
|
int |
getInMillis()
Duration of a corresponding bin in milliseconds.
|
static Utils.Granularity |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Utils.Granularity[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Utils.Granularity MINUTE
public static final Utils.Granularity HOUR
public static final Utils.Granularity DAY
public static Utils.Granularity[] values()
for (Utils.Granularity c : Utils.Granularity.values()) System.out.println(c);
public static Utils.Granularity valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getInMillis()
public int getBinId(long timeMillis)
timeMillis
- epoch time in millisecondspublic static Utils.Granularity fromMillis(long millis)
Copyright © 2017. All rights reserved.