- Enclosing class:
Method SummaryModifier and TypeMethodDescriptionDefines an alias for an existing frame.Adds all time frames in
Builder.Defines a core time frame.Defines a time frame such that each base frame consists of
countinstances of the new frame.Defines a time frame that consists of
countinstances of a base frame.Defines a time frame that is the number of a minor unit within a major frame.Defines a rollup from one frame to another.
TimeFrameSet.Replaces the epoch of the most recently added frame.
buildTimeFrameSet build()Creates a
addCoreDefines a core time frame.
addQuotientDefines a time frame that is the number of a minor unit within a major frame. For example, the "DOY" frame has minor "DAY" and major "YEAR".
addMultipleDefines a time frame that consists of
countinstances of a base frame.
addDivisionDefines a time frame such that each base frame consists of
countinstances of the new frame.
addRollupDefines a rollup from one frame to another.
An explicit rollup is not necessary for frames where one is a multiple of another (such as
HOUR). Only use this method for frames that are not multiples (such as
How do we automatically roll up from say, "minute15" to "hour7"? Because we know the following:
- "minute15" and "hour7" are based on the same core frame (seconds);
- "minute15" is 15 * 60 seconds, "hour7" is 7 * 60 * 60 seconds, and the one divides the other;
- They have the same offset, 1970-01-01 00:00:00. (Different offsets would be OK too, as they are a whole multiple apart.)
A month is not a fixed multiple of days, but a rollup is still possible, because the start of a month is always aligned with the start of a day. This means that you can compute a month total by adding up the day totals for all days in that month. This is useful if you have an aggregate table on DAY and you want to answer a query on
There is no rollup from
YEAR, because of a lack of alignment: a year does not start on the first day of a week, and so you cannot compute the total for, say, the year 2022 by adding the totals for all weeks that fall in 2022.
ISOYEARare designed so that
ISOWEEKcan roll up to
ISOWEEKstart on a Monday, so they are aligned. An
ISOYEARconsists of either 52 or 53
ISOWEEKinstances, but the variable multiple is not a problem; the alignment ensures that rollup is valid.
addAllAdds all time frames in
withEpochReplaces the epoch of the most recently added frame.
addAliasDefines an alias for an existing frame.
add("Y", "YEAR")adds "Y" as an alias for the built-in frame
name- The alias
originalName- Name of the existing frame