count

@IntRange(from = 0)
fun count(): Int

Returns the number of elements in this set.


@IntRange(from = 0)
inline fun count(predicate: (element: E) -> Boolean): Int

Returns the number of elements matching the given predicate.

Parameters

predicate

Called for all elements in the set to count the number for which it returns true.