Class DurationGranularity

  • All Implemented Interfaces:
    Cacheable

    public class DurationGranularity
    extends Granularity
    DurationGranularity buckets data based on the length of a duration
    • Constructor Detail

      • DurationGranularity

        public DurationGranularity​(long duration,
                                   org.joda.time.DateTime origin)
      • DurationGranularity

        public DurationGranularity​(long duration,
                                   long origin)
    • Method Detail

      • getDuration

        public long getDuration()
      • getOrigin

        public org.joda.time.DateTime getOrigin()
      • increment

        public org.joda.time.DateTime increment​(org.joda.time.DateTime time)
        Specified by:
        increment in class Granularity
      • bucketStart

        public org.joda.time.DateTime bucketStart​(org.joda.time.DateTime time)
        Specified by:
        bucketStart in class Granularity
      • isAligned

        public boolean isAligned​(org.joda.time.Interval interval)
        Description copied from class: Granularity
        Return true only if the time chunks populated by this granularity includes the given interval time chunk. The interval must fit exactly into the scheme of the granularity for this to return true
        Specified by:
        isAligned in class Granularity
      • getCacheKey

        public byte[] getCacheKey()
        Description copied from interface: Cacheable
        Get a byte array used as a cache key.
        Returns:
        a cache key
      • getDurationMillis

        public long getDurationMillis()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object