BitEnumSet

data class BitEnumSet<T : Enum<T>>(map: Map<T, Int>, value: Int) : MutableSet<T>

Represents the mutable set of enumeration items mapped into a bit mask.

Author

Alexander Kornilov (akornilov.82@gmail.com).

Parameters

map

a map between enum elements and bit masks.

value

a value of the set as a bit mask.

Throws

if bit masks have intersections.

Constructors

BitEnumSet
Link copied to clipboard
fun <T : Enum<T>> BitEnumSet(map: Map<T, Int>, value: Int = 0)
a map between enum elements and bit masks.

Functions

add
Link copied to clipboard
open override fun add(element: T): Boolean
Adds the specified element to the set.
addAll
Link copied to clipboard
open override fun addAll(elements: Collection<T>): Boolean
Adds all of the elements of the specified set to this set.
clear
Link copied to clipboard
open override fun clear()
Removes all elements from this set.
contains
Link copied to clipboard
open operator override fun contains(element: T): Boolean
Checks if the specified element is contained in this set.
containsAll
Link copied to clipboard
open override fun containsAll(elements: Collection<T>): Boolean
Checks if all elements in the specified set are contained in this set.
forEach
Link copied to clipboard
open fun forEach(p0: Consumer<in T>)
isEmpty
Link copied to clipboard
open override fun isEmpty(): Boolean
Returns true if the set is empty (contains no elements), false otherwise.
iterator
Link copied to clipboard
open operator override fun iterator(): MutableIterator<T>
Returns an iterator over the elements of this object.
parallelStream
Link copied to clipboard
open fun parallelStream(): Stream<T>
remove
Link copied to clipboard
open override fun remove(element: T): Boolean
Removes a single instance of the specified element from this set, if it is present.
removeAll
Link copied to clipboard
open override fun removeAll(elements: Collection<T>): Boolean
Removes all of this set's elements that are also contained in the specified set.
removeIf
Link copied to clipboard
open fun removeIf(p0: Predicate<in T>): Boolean
retainAll
Link copied to clipboard
open override fun retainAll(elements: Collection<T>): Boolean
Retains only the elements in this set that are contained in the specified set.
spliterator
Link copied to clipboard
open override fun spliterator(): Spliterator<T>
stream
Link copied to clipboard
open fun stream(): Stream<T>

Properties

map
Link copied to clipboard
val map: Map<T, Int>
a map between enum elements and bit masks.
size
Link copied to clipboard
open override val size: Int
Contains the size of the set.
value
Link copied to clipboard
var value: Int = 0
a value of the set as a bit mask.