Package com.google.android.exoplayer2.analytics

## Class AnalyticsListener.Events

- java.lang.Object
- - com.google.android.exoplayer2.analytics.AnalyticsListener.Events

- Enclosing interface:
    AnalyticsListener

      public static final class AnalyticsListener.Events
      extends Object

  A set of `AnalyticsListener.EventFlags`.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Events​(FlagSet flags, SparseArray<AnalyticsListener.EventTime> eventTimes)` | Creates an instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `contains​(int event)` | Returns whether the given event occurred.
    `boolean` | `containsAny​(int... events)` | Returns whether any of the given events occurred.
    `int` | `get​(int index)` | Returns the `event` at the given index.
    `AnalyticsListener.EventTime` | `getEventTime​(int event)` | Returns the `AnalyticsListener.EventTime` for the specified event.
    `int` | `size()` | Returns the number of events in the set.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Events

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

      Creates an instance.
      Parameters:
        `flags` - The `FlagSet` containing the `AnalyticsListener.EventFlags` in the set.
        `eventTimes` - A map from `AnalyticsListener.EventFlags` to `AnalyticsListener.EventTime`. Must at least contain all the events recorded in `flags`. Events that are not recorded in `flags` are ignored.

  - ### Method Detail

    - #### getEventTime

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

      Returns the `AnalyticsListener.EventTime` for the specified event.
      Parameters:
        `event` - The `event`.
      Returns:
        The `AnalyticsListener.EventTime` of this event.

    - #### contains

          public boolean contains​(@EventFlags
                                  int event)

      Returns whether the given event occurred.
      Parameters:
        `event` - The `event`.
      Returns:
        Whether the event occurred.

    - #### containsAny

          public boolean containsAny​(@EventFlags
                                     int... events)

      Returns whether any of the given events occurred.
      Parameters:
        `events` - The `events`.
      Returns:
        Whether any of the events occurred.

    - #### size

          public int size()

      Returns the number of events in the set.

    - #### get

          @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:
        `index` - The index. Must be between 0 (inclusive) and `size()` (exclusive).
      Returns:
        The `event` at the given index.