AI-generated Key Takeaways
-
A LocalBucket represents a time interval for aggregated data, like a user's step count over an hour or day.
-
Each bucket includes a start time, an end time, and the aggregated data sets for the requested data types within that interval.
-
The TYPE_TIME constant indicates that bucketing is requested by time.
A bucket represents a time interval over which aggregated data is computed. For example, a bucket can represent user's step count over a 1 hour interval. We allow buckets to be computed by time, where a time bucket can represent a full day, hour, or any other desired interval.
A bucket consists of the following fields:
-
startTimedenotes the start time of the bucket. This field is always present. -
endTimedenotes the end time of the bucket. This field is always present. -
dataSetsLocalDataSetfor the aggregatedLocalDataTyperequested in the read query over the time interval of this bucket.
Constant Summary
| int | TYPE_TIME | Type constant denoting that bucketing by time is requested. |
Public Method Summary
| boolean | |
| int | |
| LocalDataSet | getDataSet
( LocalDataType
dataType)
Returns the data set of requested data type over the time interval of the
bucket.
|
| List < LocalDataSet > | |
| long | getEndTime
( TimeUnit
timeUnit)
Returns the end time of the bucket, in the given time unit since epoch.
|
| long | getStartTime
( TimeUnit
timeUnit)
Returns the start time of the bucket, in the given time unit since epoch.
|
| int | hashCode
()
|
| String | toString
()
|
Inherited Method Summary
Constants
public static final int TYPE_TIME
Type constant denoting that bucketing by time is requested.
Public Methods
public boolean equals ( Object other)
public int getBucketType ()
Returns the type of the bucket.
public LocalDataSet getDataSet ( LocalDataType dataType)
Returns the data set of requested data type over the time interval of the bucket. Returns null, if data set for the requested type is not found.
public List < LocalDataSet > getDataSets ()
Returns the requested data sets over the time interval of the bucket.
public long getEndTime ( TimeUnit timeUnit)
Returns the end time of the bucket, in the given time unit since epoch.
public long getStartTime ( TimeUnit timeUnit)
Returns the start time of the bucket, in the given time unit since epoch.

