Package com.onenetwork.platform.data.tlv
Interface TimelineService
- All Superinterfaces:
Service
public interface TimelineService extends Service
Various utility functions to manipulate Timeline generation.
-
Method Summary
Modifier and Type Method Description java.util.Map<java.lang.Integer,java.lang.Float>
transform(TimelineDefinition timelineDef, java.util.List<BucketizedValue> sourceBucketizedVals, java.util.Map<Bucketization,java.lang.String> transformFuncs, PlatformUserContext platformUserContext)
Generates bucket data for aggregated data points.
-
Method Details
-
transform
java.util.Map<java.lang.Integer,java.lang.Float> transform(TimelineDefinition timelineDef, java.util.List<BucketizedValue> sourceBucketizedVals, java.util.Map<Bucketization,java.lang.String> transformFuncs, PlatformUserContext platformUserContext)Generates bucket data for aggregated data points. For example, if a timeline is generated for DAILY bucketization but some of the underyling data is WEEKLY, this function can be used to "disaggregate" the data using transform functions into DAILY buckets. The following standard transform functions are provided by ONE:Name Description first Put all data into first bucket last Put all data into last bucket fairShare Split value equally into all buckets based on number of buckets (not duration) fairShareRoundedFavorFirst Like fairShare, but round to integers, putting any remainder in the first bucket fairShareRoundedFavorLast Like fairShare, but round to integers, putting any remainder in the last bucket byDuration Disaggregate value in proportion to the duration of each bucket (i.e. a MONTHLY bucket will get a greater share than a WEEKLY bucket) byDurationRoundedFavorFirst Like byDuration, but round to integers, putting any remainder in the first bucket byDurationRoundedFavorLast Like byDuration, but round to integers, putting any remainder in the last bucket <BucketTransform sourceBucketType="MONTHLY" transformFunction="byDuration"/>
You can also define your own transform function by implementing theBucketTransformer
interface and provide fully qualified name of the class in the transformFuncs param below.- Parameters:
timelineDef
- contains the startDayOfWeek, buckets on timeline etc.sourceBucketizedVals
- raw, untransformed bucket datatransformFuncs
- map of source bucketization to transform function. Transform function can be one of the names above, or a fully-qualifiedBucketTransformer
implementlation classname.platformUserContext
- caller's context- Returns:
- the list Map of affected bucket indexes (relative to timelineDef) and their new values
-