Enum ArchivedCrunchedHistoryConfig.UnitTime

    • Field Detail

      • EMPTY

        public static final com.google.common.collect.Range<java.lang.Long> EMPTY
    • 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 name
        java.lang.NullPointerException - if the argument is null
      • isEmptyRange

        public static boolean isEmptyRange​(com.google.common.collect.Range<java.lang.Long> r)
      • 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 updated
        baselineTime - time all the timeslices and ranges for crunching will be based off of. (typically System.curentTimeInMillis())
      • 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)