@UnstableApi
class FlagSet


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.

Instances are immutable.

Summary

Nested types

A builder for FlagSet instances.

Public functions

Boolean
contains(flag: Int)

Returns whether the set contains the given flag.

Boolean

Returns whether the set contains at least one of the given flags.

Boolean

Returns whether this FlagSet contains at least one of the flags in the other Flagset.

Boolean
equals(o: Any?)
Int
get(index: Int)

Returns the flag at the given index.

Int
Int

Returns the number of flags in this set.

Public functions

contains

fun contains(flag: Int): Boolean

Returns whether the set contains the given flag.

Parameters
flag: Int

The flag.

Returns
Boolean

Whether the set contains the flag.

containsAny

fun containsAny(flags: IntArray!): Boolean

Returns whether the set contains at least one of the given flags.

Parameters
flags: IntArray!

The flags.

Returns
Boolean

Whether the set contains at least one of the flags.

containsAny

fun containsAny(other: FlagSet!): Boolean

Returns whether this FlagSet contains at least one of the flags in the other Flagset.

Parameters
other: FlagSet!

The flag.

Returns
Boolean

Whether the set contains the flag.

equals

fun equals(o: Any?): Boolean

get

fun get(index: Int): Int

Returns the flag at the given index.

Parameters
index: Int

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

Returns
Int

The flag at the given index.

Throws
java.lang.IndexOutOfBoundsException

If index is outside the allowed range.

hashCode

fun hashCode(): Int

size

fun size(): Int

Returns the number of flags in this set.