LocalBucket

public class LocalBucket extends Object

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:

  • startTime denotes the start time of the bucket. This field is always present.
  • endTime denotes the end time of the bucket. This field is always present.
  • dataSets LocalDataSet for the aggregated LocalDataType requested 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
equals(Object other)
int
getBucketType()
Returns the type of the bucket.
LocalDataSet
getDataSet(LocalDataType dataType)
Returns the data set of requested data type over the time interval of the bucket.
List<LocalDataSet>
getDataSets()
Returns the requested data sets over the time interval of the bucket.
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
String

Inherited Method Summary

Constants

public static final int TYPE_TIME

Type constant denoting that bucketing by time is requested.

Constant Value: 1

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.

public int hashCode ()

public String toString ()