AnalyticsListener.Events


@UnstableApi
public final class AnalyticsListener.Events


A set of EventFlags.

Summary

Public constructors

Events(
    FlagSet flags,
    SparseArray<AnalyticsListener.EventTime> eventTimes
)

Creates an instance.

Public methods

boolean

Returns whether the given event occurred.

boolean

Returns whether any of the given events occurred.

int

Returns the event at the given index.

AnalyticsListener.EventTime

Returns the EventTime for the specified event.

int

Returns the number of events in the set.

Public constructors

Events

public Events(
    FlagSet flags,
    SparseArray<AnalyticsListener.EventTime> eventTimes
)

Creates an instance.

Parameters
FlagSet flags

The FlagSet containing the EventFlags in the set.

SparseArray<AnalyticsListener.EventTime> eventTimes

A map from EventFlags to EventTime. Must at least contain all the events recorded in flags. Events that are not recorded in flags are ignored.

Public methods

contains

public boolean contains(@AnalyticsListener.EventFlags int event)

Returns whether the given event occurred.

Parameters
@AnalyticsListener.EventFlags int event

The event.

Returns
boolean

Whether the event occurred.

containsAny

public boolean containsAny(@AnalyticsListener.EventFlags int[] events)

Returns whether any of the given events occurred.

Parameters
@AnalyticsListener.EventFlags int[] events

The events.

Returns
boolean

Whether any of the events occurred.

get

@AnalyticsListener.EventFlags
public int get(int index)

Returns the event at the given index.

Although index-based access is possible, it doesn't imply a particular order of these events.

Parameters
int index

The index. Must be between 0 (inclusive) and size (exclusive).

Returns
int

The event at the given index.

getEventTime

public AnalyticsListener.EventTime getEventTime(@AnalyticsListener.EventFlags int event)

Returns the EventTime for the specified event.

Parameters
@AnalyticsListener.EventFlags int event

The event.

Returns
AnalyticsListener.EventTime

The EventTime of this event.

size

public int size()

Returns the number of events in the set.