Adds elem
without checking for duplicates.
Adds elem
without checking for duplicates.
For isArray == true
, the current capacity of the internal array else 0.
Compacts the current representation depending on ArraySet.Hints.compactUpToUsed.
Returns a random element of the set if it is nonEmpty
otherwise throws
IllegalArgumentException
.
Returns a random element of the set if it is nonEmpty
otherwise throws
IllegalArgumentException
.
a random generator; it is essential that random
be instantiated
by the caller just once for any sequence of calls
Finds an entry in the collection based on toMatch
's hashCode
and a correspondence
function but not on the argument type.
Finds an entry in the collection based on toMatch
's hashCode
and a correspondence
function but not on the argument type.
a value not necessarily of type A
; the entry to be searched for
must have the same hashCode
and be equal to this argument
function returning whether a given entry corresponds to other
the entry corresponding to toMatch
or null if not contained
The hints valid for this ArraySet!.
Whether the internal representation is currently based on Array
.
Sorts this ArraySet
according to an Ordering in place.
Sorts this ArraySet
according to an Ordering in place.
scala.collection.SeqLike
Updates or inserts elem
.
(Changed in version 2.8.0) +
creates a new set. Use +=
to add an element to this set and return that set itself.
(Changed in version 2.8.0) +
creates a new set. Use +=
to add an element to this set and return that set itself.
(Changed in version 2.8.0) ++
creates a new set. Use ++=
to add elements to this set and return that set itself.
(Changed in version 2.8.0) -
creates a new set. Use -=
to remove an element from this set and return that set itself.
(Changed in version 2.8.0) -
creates a new set. Use -=
to remove an element from this set and return that set itself.
(Changed in version 2.8.0) --
creates a new set. Use --=
to remove elements from this set and return that set itself.
(Changed in version 2.8.0) Set.map now returns a Set, so it will discard duplicate values.
(Changed in version 2.9.0) The behavior of scanRight
has changed. The previous behavior can be reproduced with scanRight.reverse.
Sorts this ArraySet
according to the Ordering which results from transforming
an implicitly given Ordering with a transformation function in place.
Sorts this ArraySet
according to the Ordering which results from transforming
an implicitly given Ordering with a transformation function in place.
scala.collection.SeqLike
Sorts this ArraySet
according to a comparison function in place.
Sorts this ArraySet
according to a comparison function in place.
scala.collection.SeqLike
(Changed in version 2.9.0) transpose
throws an IllegalArgumentException
if collections are not uniformly sized.
Returns a lazily filtered immutable Set.
Returns a lazily filtered immutable Set.
(arraySet: any2stringadd[ArraySet[A]]).+(other)
(arraySet: MonadOps[A]).filter(p)
(arraySet: MonadOps[A]).flatMap(f)
(arraySet: MonadOps[A]).map(f)
(arraySet: MonadOps[A]).withFilter(p)
(Since version 2.11.0) Scripting is deprecated.
A growable and compactable
mutable.Set
implementation based onArray
andmutable.Set
. It switches to the latter representation as soon as a given threshold for the number of elements is reached. Thus this implementation is a kind of mixture of scala.collection.mutable{ResizableArray, Set, HashSet} aimed at increasing the performance of sets having up to 200 to 250 elements.