Enum ArchivedCrunchedHistoryConfig.UnitTime
- java.lang.Object
-
- java.lang.Enum<ArchivedCrunchedHistoryConfig.UnitTime>
-
- unlimited.fc.client.core.util.selfUpdatingDataStructure.history.ArchivedCrunchedHistoryConfig.UnitTime
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ArchivedCrunchedHistoryConfig.UnitTime>
- Enclosing class:
- ArchivedCrunchedHistoryConfig
public static enum ArchivedCrunchedHistoryConfig.UnitTime extends java.lang.Enum<ArchivedCrunchedHistoryConfig.UnitTime>
-
-
Field Summary
Fields Modifier and Type Field Description static com.google.common.collect.Range<java.lang.Long>
EMPTY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<java.util.Date>
getNeededDates(com.google.common.collect.Range<java.lang.Long> r, int sizeOfEachSegment)
protected java.util.Calendar
getPreviousCalendar(java.util.Calendar time)
protected com.google.common.collect.Range<java.lang.Long>
getRangeFromCalendar(java.util.Calendar c)
com.google.common.collect.Range<java.lang.Long>
getRangeIntersection(com.google.common.collect.Range<java.lang.Long> r, java.util.function.Supplier<java.lang.Long> timeNow)
java.util.Calendar
getRoundedCalendar(long time)
int
getTotalUnitsInRange(com.google.common.collect.Range<java.lang.Long> r)
int
getUnitCount()
long
getUnitTimeSpan()
protected java.util.Calendar
getUpcomingCalendar(long now)
int
hoursPerUnit()
protected void
initializeIfNeeded(ArchivedCrunchedHistoryConfig conf, long now)
static boolean
isEmptyRange(com.google.common.collect.Range<java.lang.Long> r)
java.lang.String
toString()
void
update(ArchivedCrunchedHistoryConfig conf, long baselineTime)
static ArchivedCrunchedHistoryConfig.UnitTime
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ArchivedCrunchedHistoryConfig.UnitTime[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
HOURS
public static final ArchivedCrunchedHistoryConfig.UnitTime HOURS
-
DAYS
public static final ArchivedCrunchedHistoryConfig.UnitTime DAYS
-
WEEKS
public static final ArchivedCrunchedHistoryConfig.UnitTime WEEKS
-
-
Method Detail
-
values
public static ArchivedCrunchedHistoryConfig.UnitTime[] 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 (ArchivedCrunchedHistoryConfig.UnitTime c : ArchivedCrunchedHistoryConfig.UnitTime.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ArchivedCrunchedHistoryConfig.UnitTime 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
-
isEmptyRange
public static boolean isEmptyRange(com.google.common.collect.Range<java.lang.Long> r)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<ArchivedCrunchedHistoryConfig.UnitTime>
-
getUnitCount
public int getUnitCount()
- Returns:
- How many individual time segments this unit of time will be broken into
-
getUnitTimeSpan
public long getUnitTimeSpan()
- Returns:
- How much time, in milliseconds, each time segment represents
-
update
public void update(ArchivedCrunchedHistoryConfig conf, long baselineTime)
- Parameters:
conf
- config to be updatedbaselineTime
- time all the timeslices and ranges for crunching will be based off of. (typically System.curentTimeInMillis())
-
initializeIfNeeded
protected void initializeIfNeeded(ArchivedCrunchedHistoryConfig conf, long now)
-
getUpcomingCalendar
protected java.util.Calendar getUpcomingCalendar(long now)
-
getRoundedCalendar
public java.util.Calendar getRoundedCalendar(long time)
-
getPreviousCalendar
protected java.util.Calendar getPreviousCalendar(java.util.Calendar time)
-
getRangeFromCalendar
protected com.google.common.collect.Range<java.lang.Long> getRangeFromCalendar(java.util.Calendar c)
-
hoursPerUnit
public int hoursPerUnit()
-
getRangeIntersection
public com.google.common.collect.Range<java.lang.Long> getRangeIntersection(com.google.common.collect.Range<java.lang.Long> r, java.util.function.Supplier<java.lang.Long> timeNow)
-
getNeededDates
public java.util.Set<java.util.Date> getNeededDates(com.google.common.collect.Range<java.lang.Long> r, int sizeOfEachSegment)
-
getTotalUnitsInRange
public int getTotalUnitsInRange(com.google.common.collect.Range<java.lang.Long> r)
-
-