ArraySet

scalax.collection.mutable.ArraySet
See theArraySet companion object

A growable and compactable mutable.Set implementation based on Array and mutable.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.

Attributes

Companion
object
Graph
Supertypes
trait ExtSetMethods[A]
trait FilterableSet[A]
class AbstractSet[A]
trait Set[A]
trait SetOps[A, ArraySet, ArraySet[A]]
trait Shrinkable[A]
trait Builder[A, ArraySet[A]]
trait Growable[A]
trait Clearable
trait Cloneable[ArraySet[A]]
trait Cloneable
trait Iterable[A]
class AbstractSet[A]
trait Set[A]
trait Equals
trait SetOps[A, ArraySet, ArraySet[A]]
trait A => Boolean
class AbstractIterable[A]
trait Iterable[A]
trait IterableOps[A, ArraySet, ArraySet[A]]
trait IterableOnce[A]
class Object
trait Matchable
class Any
Show all
Known subtypes
class SimpleArraySet[A]

Members list

Value members

Abstract methods

def capacity: Int

For isArray == true, the current capacity of the internal array else 0.

For isArray == true, the current capacity of the internal array else 0.

Attributes

def compact(): Unit

Compacts the current representation depending on ArraySet.Hints.compactUpToUsed.

Compacts the current representation depending on ArraySet.Hints.compactUpToUsed.

Attributes

def find(elem: A): Option[A]
def hints: Hints

The hints valid for this ArraySet!.

The hints valid for this ArraySet!.

Attributes

Whether the internal representation is currently based on Array.

Whether the internal representation is currently based on Array.

Attributes

def sorted(implicit ord: Ordering[A]): SortedSet[A]

Sorts this ArraySet according to an Ordering in place.

Sorts this ArraySet according to an Ordering in place.

Attributes

See also

scala.collection.SeqLike

Concrete methods

Attributes

Definition Classes
def sortBy(f: A => A)(implicit ord: Ordering[A]): SortedSet[A]

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.

Attributes

See also

scala.collection.SeqLike

def sortWith(lt: (A, A) => Boolean): SortedSet[A]

Sorts this ArraySet according to a comparison function in place.

Sorts this ArraySet according to a comparison function in place.

Attributes

See also

scala.collection.SeqLike

Inherited methods

final def &(that: Set[A]): C

Attributes

Inherited from:
SetOps
final def &~(that: Set[A]): C

Attributes

Inherited from:
SetOps
final def ++[B >: A](suffix: IterableOnce[B]): CC[B]

Attributes

Inherited from:
IterableOps
final def ++(that: IterableOnce[A]): C

Attributes

Inherited from:
SetOps
final def ++=(xs: IterableOnce[A]): Growable.this.type

Attributes

Inherited from:
Growable
final def +=(elem: A): Growable.this.type

Attributes

Inherited from:
Growable
final def --=(xs: IterableOnce[A]): Shrinkable.this.type

Attributes

Inherited from:
Shrinkable
final def -=(elem: A): Shrinkable.this.type

Attributes

Inherited from:
Shrinkable
def add(elem: A): Boolean

Attributes

Inherited from:
SetOps
def addAll(xs: IterableOnce[A]): Growable.this.type

Attributes

Inherited from:
Growable
def addOne(elem: A): Growable.this.type

Attributes

Inherited from:
Growable

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOnceOps
def andThen[A](g: Boolean => A): T1 => A

Attributes

Inherited from:
Function1
final def apply(elem: A): Boolean

Attributes

Inherited from:
SetOps
def canEqual(that: Any): Boolean

Attributes

Inherited from:
Set
def clear(): Unit

Attributes

Inherited from:
Builder
override def clone(): C

Create a copy of the receiver object.

Create a copy of the receiver object.

The default implementation of the clone method is platform dependent.

Attributes

Returns

a copy of the receiver object.

Note

not specified by SLS as a member of AnyRef

Definition Classes
SetOps -> Cloneable -> Object
Inherited from:
SetOps
def collect[B](pf: PartialFunction[A, B]): CC[B]

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOnceOps
def compose[A](g: A => A): A => R

Attributes

Inherited from:
Function1
def concat[B >: A](suffix: IterableOnce[B]): CC[B]

Attributes

Inherited from:
IterableOps
def concat(that: IterableOnce[A]): C

Attributes

Inherited from:
SetOps
def contains(elem: A): Boolean

Attributes

Inherited from:
SetOps
def copyToArray[B >: A](xs: Array[B], start: Int, len: Int): Int

Attributes

Inherited from:
IterableOnceOps
def copyToArray[B >: A](xs: Array[B], start: Int): Int

Attributes

Inherited from:
IterableOnceOps
def copyToArray[B >: A](xs: Array[B]): Int

Attributes

Inherited from:
IterableOnceOps
def corresponds[B](that: IterableOnce[B])(p: (A, B) => Boolean): Boolean

Attributes

Inherited from:
IterableOnceOps
def count(p: A => Boolean): Int

Attributes

Inherited from:
IterableOnceOps
def diff(that: Set[A]): C

Attributes

Inherited from:
SetOps
def draw(random: Random): A

Returns a random element of the set if it is nonEmpty otherwise throws IllegalArgumentException. Note that currently a near- but no true-uniform distribution is granted to allow for O(1) implementation.

Returns a random element of the set if it is nonEmpty otherwise throws IllegalArgumentException. Note that currently a near- but no true-uniform distribution is granted to allow for O(1) implementation.

Value parameters

random

a random generator; it is essential that random be instantiated by the caller just once for any sequence of calls

Attributes

Inherited from:
ExtSetMethods
def drop(n: Int): C

Attributes

Inherited from:
IterableOps
def dropRight(n: Int): C

Attributes

Inherited from:
IterableOps
def dropWhile(p: A => Boolean): C

Attributes

Inherited from:
IterableOps
override def empty: CC[A]

Attributes

Definition Classes
Inherited from:
IterableFactoryDefaults
override def equals(that: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Value parameters

that

the object to compare against this object for equality.

Attributes

Returns

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
Set -> Equals -> Any
Inherited from:
Set
def exists(p: A => Boolean): Boolean

Attributes

Inherited from:
IterableOnceOps
def filter(pred: A => Boolean): C

Attributes

Inherited from:
IterableOps
def filterInPlace(p: A => Boolean): SetOps.this.type

Attributes

Inherited from:
SetOps
def filterNot(pred: A => Boolean): C

Attributes

Inherited from:
IterableOps
def find(p: A => Boolean): Option[A]

Attributes

Inherited from:
IterableOnceOps
def findElem[B](toMatch: B, correspond: (A, B) => Boolean): A

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.

Value parameters

correspond

function returning whether a given entry corresponds to other

toMatch

a value not necessarily of type A; the entry to be searched for must have the same hashCode and be equal to this argument

Attributes

Returns

the entry corresponding to toMatch or null if not contained

Inherited from:
ExtSetMethods
def findElem(elem: A): Option[A]

Attributes

Inherited from:
ExtSetMethods
def flatMap[B](f: A => IterableOnce[B]): CC[B]

Attributes

Inherited from:
IterableOps
def flatten[B](implicit asIterable: A => IterableOnce[B]): CC[B]

Attributes

Inherited from:
IterableOps
def fold[A1 >: A](z: A1)(op: (A1, A1) => A1): A1

Attributes

Inherited from:
IterableOnceOps
def foldLeft[B](z: B)(op: (B, A) => B): B

Attributes

Inherited from:
IterableOnceOps
def foldRight[B](z: B)(op: (A, B) => B): B

Attributes

Inherited from:
IterableOnceOps
def forall(p: A => Boolean): Boolean

Attributes

Inherited from:
IterableOnceOps
def foreach[U](f: A => U): Unit

Attributes

Inherited from:
IterableOnceOps
protected def fromSpecific(coll: IterableOnce[A]): CC[A]

Attributes

Inherited from:
IterableFactoryDefaults
def groupBy[K](f: A => K): Map[K, C]

Attributes

Inherited from:
IterableOps
def groupMap[K, B](key: A => K)(f: A => B): Map[K, CC[B]]

Attributes

Inherited from:
IterableOps
def groupMapReduce[K, B](key: A => K)(f: A => B)(reduce: (B, B) => B): Map[K, B]

Attributes

Inherited from:
IterableOps
def grouped(size: Int): Iterator[C]

Attributes

Inherited from:
IterableOps
override def hashCode(): Int

Calculate a hash code value for the object.

Calculate a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Attributes

Returns

the hash code value for this object.

Definition Classes
Set -> Any
Inherited from:
Set
def head: A

Attributes

Inherited from:
IterableOps
def headOption: Option[A]

Attributes

Inherited from:
IterableOps
def init: C

Attributes

Inherited from:
IterableOps
def inits: Iterator[C]

Attributes

Inherited from:
IterableOps
def intersect(that: Set[A]): C

Attributes

Inherited from:
SetOps

Attributes

Inherited from:
IterableOnceOps
override def isTraversableAgain: Boolean

Attributes

Definition Classes
Inherited from:
IterableOps
def iterator: Iterator[A]

Attributes

Inherited from:
IterableOnce
override def knownSize: Int

Attributes

Definition Classes
Inherited from:
SetOps
def last: A

Attributes

Inherited from:
IterableOps
def lastOption: Option[A]

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
Iterable
def map[B](f: A => B): CC[B]

Attributes

Inherited from:
IterableOps
def mapResult[NewTo](f: ArraySet[A] => NewTo): Builder[A, NewTo]

Attributes

Inherited from:
Builder
def max[B >: A](implicit ord: Ordering[B]): A

Attributes

Inherited from:
IterableOnceOps
def maxBy[B](f: A => B)(implicit ord: Ordering[B]): A

Attributes

Inherited from:
IterableOnceOps
def maxByOption[B](f: A => B)(implicit ord: Ordering[B]): Option[A]

Attributes

Inherited from:
IterableOnceOps
def maxOption[B >: A](implicit ord: Ordering[B]): Option[A]

Attributes

Inherited from:
IterableOnceOps
def min[B >: A](implicit ord: Ordering[B]): A

Attributes

Inherited from:
IterableOnceOps
def minBy[B](f: A => B)(implicit ord: Ordering[B]): A

Attributes

Inherited from:
IterableOnceOps
def minByOption[B](f: A => B)(implicit ord: Ordering[B]): Option[A]

Attributes

Inherited from:
IterableOnceOps
def minOption[B >: A](implicit ord: Ordering[B]): Option[A]

Attributes

Inherited from:
IterableOnceOps
final def mkString: String

Attributes

Inherited from:
IterableOnceOps
final def mkString(sep: String): String

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOnceOps
protected def newSpecificBuilder: Builder[A, CC[A]]

Attributes

Inherited from:
IterableFactoryDefaults

Attributes

Inherited from:
IterableOnceOps
def partition(p: A => Boolean): (C, C)

Attributes

Inherited from:
IterableOps
def partitionMap[A1, A2](f: A => Either[A1, A2]): (CC[A1], CC[A2])

Attributes

Inherited from:
IterableOps
def product[B >: A](implicit num: Numeric[B]): B

Attributes

Inherited from:
IterableOnceOps
def reduce[B >: A](op: (B, B) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceLeft[B >: A](op: (B, A) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceLeftOption[B >: A](op: (B, A) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
def reduceOption[B >: A](op: (B, B) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
def reduceRight[B >: A](op: (A, B) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceRightOption[B >: A](op: (A, B) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
def remove(elem: A): Boolean

Attributes

Inherited from:
SetOps
def result(): C

Attributes

Inherited from:
SetOps
protected def reversed: Iterable[A]

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
Cloneable
def scan[B >: A](z: B)(op: (B, B) => B): CC[B]

Attributes

Inherited from:
IterableOps
def scanLeft[B](z: B)(op: (B, A) => B): CC[B]

Attributes

Inherited from:
IterableOps
def scanRight[B](z: B)(op: (A, B) => B): CC[B]

Attributes

Inherited from:
IterableOps
def size: Int

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps
final def sizeHint(coll: IterableOnce[_], delta: Int): Unit

Attributes

Inherited from:
Builder

Attributes

Inherited from:
Builder

Attributes

Inherited from:
Builder
final def sizeIs: SizeCompareOps

Attributes

Inherited from:
IterableOps
def slice(from: Int, until: Int): C

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps
def sliding(size: Int): Iterator[C]

Attributes

Inherited from:
IterableOps
def span(p: A => Boolean): (C, C)

Attributes

Inherited from:
IterableOps
override def splitAt(n: Int): (C, C)

Attributes

Definition Classes
Inherited from:
IterableOps
def stepper[S <: Stepper[_]](implicit shape: StepperShape[A, S]): S

Attributes

Inherited from:
IterableOnce
def subsetOf(that: Set[A]): Boolean

Attributes

Inherited from:
SetOps
def subsets(): Iterator[C]

Attributes

Inherited from:
SetOps
def subsets(len: Int): Iterator[C]

Attributes

Inherited from:
SetOps
def subtractAll(xs: IterableOnce[A]): Shrinkable.this.type

Attributes

Inherited from:
Shrinkable
def subtractOne(elem: A): Shrinkable.this.type

Attributes

Inherited from:
Shrinkable
def sum[B >: A](implicit num: Numeric[B]): B

Attributes

Inherited from:
IterableOnceOps
def tail: C

Attributes

Inherited from:
IterableOps
def tails: Iterator[C]

Attributes

Inherited from:
IterableOps
def take(n: Int): C

Attributes

Inherited from:
IterableOps
def takeRight(n: Int): C

Attributes

Inherited from:
IterableOps
def takeWhile(p: A => Boolean): C

Attributes

Inherited from:
IterableOps
override def tapEach[U](f: A => U): C

Attributes

Definition Classes
Inherited from:
IterableOps
def to[C1](factory: Factory[A, C1]): C1

Attributes

Inherited from:
IterableOnceOps
def toArray[B >: A : ClassTag]: Array[B]

Attributes

Inherited from:
IterableOnceOps
final def toBuffer[B >: A]: Buffer[B]

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOnceOps
def toList: List[A]

Attributes

Inherited from:
IterableOnceOps
def toMap[K, V](implicit ev: A <:< (K, V)): Map[K, V]

Attributes

Inherited from:
IterableOnceOps
def toSeq: Seq[A]

Attributes

Inherited from:
IterableOnceOps
def toSet[B >: A]: Set[B]

Attributes

Inherited from:
IterableOnceOps
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Set -> Function1 -> Iterable -> Any
Inherited from:
Set
def toVector: Vector[A]

Attributes

Inherited from:
IterableOnceOps
def transpose[B](implicit asIterable: A => Iterable[B]): CC[CC[B]]

Attributes

Inherited from:
IterableOps
final def union(that: Set[A]): C

Attributes

Inherited from:
SetOps
def unzip[A1, A2](implicit asPair: A => (A1, A2)): (CC[A1], CC[A2])

Attributes

Inherited from:
IterableOps
def unzip3[A1, A2, A3](implicit asTriple: A => (A1, A2, A3)): (CC[A1], CC[A2], CC[A3])

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
SetOps
def view: View[A]

Attributes

Inherited from:
IterableOps
def withFilter(p: A => Boolean): WithFilter[A, CC]

Attributes

Inherited from:
IterableOps
def withSetFilter(p: A => Boolean): Set[A] & FilterableSet[A]

Attributes

Inherited from:
FilterableSet
def zip[B](that: IterableOnce[B]): CC[(A, B)]

Attributes

Inherited from:
IterableOps
def zipAll[A1 >: A, B](that: Iterable[B], thisElem: A1, thatElem: B): CC[(A1, B)]

Attributes

Inherited from:
IterableOps
def zipWithIndex: CC[(A, Int)]

Attributes

Inherited from:
IterableOps
final def |(that: Set[A]): C

Attributes

Inherited from:
SetOps

Deprecated and Inherited methods

def +(elem1: A, elem2: A, elems: A*): C

Attributes

Deprecated
[Since version 2.13.0] Use ++ with an explicit collection argument instead of + with varargs
Inherited from:
SetOps
def +(elem: A): C

Attributes

Deprecated
[Since version 2.13.0] Consider requiring an immutable Set or fall back to Set.union
Inherited from:
SetOps
def ++:[B >: A](that: IterableOnce[B]): CC[B]

Attributes

Deprecated
[Since version 2.13.0] Use ++ instead of ++: for collections of type Iterable
Inherited from:
IterableOps
final def +=(elem1: A, elem2: A, elems: A*): Growable.this.type

Attributes

Deprecated
[Since version 2.13.0] Use `++=` aka `addAll` instead of varargs `+=`; infix operations with an operand of multiple args will be deprecated
Inherited from:
Growable
def -(elem1: A, elem2: A, elems: A*): C

Attributes

Deprecated
[Since version 2.13.0] Use &- with an explicit collection argument instead of - with varargs
Inherited from:
SetOps
def -(elem: A): C

Attributes

Deprecated
[Since version 2.13.0] Consider requiring an immutable Set or fall back to Set.diff
Inherited from:
SetOps
def --(that: IterableOnce[A]): C

Attributes

Deprecated
[Since version 2.13.0] Consider requiring an immutable Set
Inherited from:
SetOps
def -=(elem1: A, elem2: A, elems: A*): Shrinkable.this.type

Attributes

Deprecated
[Since version 2.13.3] Use `--=` aka `subtractAll` instead of varargs `-=`; infix operations with an operand of multiple args will be deprecated
Inherited from:
Shrinkable
final def /:[B](z: B)(op: (B, A) => B): B

Attributes

Deprecated
[Since version 2.13.0] Use foldLeft instead of /:
Inherited from:
IterableOnceOps
final def :\[B](z: B)(op: (A, B) => B): B

Attributes

Deprecated
[Since version 2.13.0] Use foldRight instead of :\\
Inherited from:
IterableOnceOps
def aggregate[B](z: => B)(seqop: (B, A) => B, combop: (B, B) => B): B

Attributes

Deprecated
[Since version 2.13.0] `aggregate` is not relevant for sequential collections. Use `foldLeft(z)(seqop)` instead.
Inherited from:
IterableOnceOps

Attributes

Deprecated
[Since version 2.13.0] Use iterableFactory instead
Inherited from:
IterableOps
final def copyToBuffer[B >: A](dest: Buffer[B]): Unit

Attributes

Deprecated
[Since version 2.13.0] Use `dest ++= coll` instead
Inherited from:
IterableOnceOps

Attributes

Deprecated
[Since version 2.13.0] Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)
Inherited from:
IterableOnceOps
final def repr: C

Attributes

Deprecated
[Since version 2.13.0] Use coll instead of repr in a collection implementation, use the collection value itself from the outside
Inherited from:
IterableOps
final def retain(p: A => Boolean): Unit

Attributes

Deprecated
[Since version 2.13.0] Use filterInPlace instead
Inherited from:
SetOps
def seq: Iterable.this.type

Attributes

Deprecated
[Since version 2.13.0] Iterable.seq always returns the iterable itself
Inherited from:
Iterable
final def toIterable: Iterable.this.type

Attributes

Deprecated
[Since version 2.13.7] toIterable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections
Inherited from:
Iterable
final def toIterator: Iterator[A]

Attributes

Deprecated
[Since version 2.13.0] Use .iterator instead of .toIterator
Inherited from:
IterableOnceOps
final def toStream: Stream[A]

Attributes

Deprecated
[Since version 2.13.0] Use .to(LazyList) instead of .toStream
Inherited from:
IterableOnceOps
final def toTraversable: Iterable[A]

Attributes

Deprecated
[Since version 2.13.0] toTraversable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections
Inherited from:
IterableOps
def view(from: Int, until: Int): View[A]

Attributes

Deprecated
[Since version 2.13.0] Use .view.slice(from, until) instead of .view(from, until)
Inherited from:
IterableOps