Class MutableFlags
- java.lang.Object
-
- com.google.android.exoplayer2.util.MutableFlags
-
- Direct Known Subclasses:
AnalyticsListener.Events
,Player.Events
public class MutableFlags extends Object
A set of integer flags.Intended for usages where the number of flags may exceed 32 and can no longer be represented by an IntDef.
-
-
Constructor Summary
Constructors Constructor Description MutableFlags()
Creates the set of flags.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int flag)
Adds a flag to the set.void
clear()
Clears all previously set flags.boolean
contains(int flag)
Returns whether the set contains the given flag.boolean
containsAny(int... flags)
Returns whether the set contains at least one of the given flags.boolean
equals(Object o)
int
get(int index)
Returns the flag at the given index.int
hashCode()
int
size()
Returns the number of flags in this set.
-
-
-
Method Detail
-
clear
public void clear()
Clears all previously set flags.
-
add
public void add(int flag)
Adds a flag to the set.- Parameters:
flag
- The flag to add.
-
contains
public boolean contains(int flag)
Returns whether the set contains the given flag.- Parameters:
flag
- The flag.- Returns:
- Whether the set contains the flag.
-
containsAny
public boolean containsAny(int... flags)
Returns whether the set contains at least one of the given flags.- Parameters:
flags
- The flags.- Returns:
- Whether the set contains at least one of the flags.
-
size
public int size()
Returns the number of flags in this set.
-
get
public int get(int index)
Returns the flag at the given index.- Parameters:
index
- The index. Must be between 0 (inclusive) andsize()
(exclusive).- Returns:
- The flag at the given index.
- Throws:
IllegalArgumentException
- If index is outside the allowed range.
-
-