scala.collection.mutable

SetProxy

trait SetProxy[A] extends Set[A] with SetProxyLike[A, Set[A]]

This is a simple wrapper class for scala.collection.mutable.Set. It is most useful for assembling customized set abstractions dynamically using object composition and forwarding.

Inherits

  1. SetProxyLike
  2. IterableProxyLike
  3. TraversableProxyLike
  4. Proxy
  5. Set
  6. SetLike
  7. Cloneable
  8. Shrinkable
  9. Builder
  10. Growable
  11. Scriptable
  12. Set
  13. SetLike
  14. Subtractable
  15. Addable
  16. GenericSetTemplate
  17. Function1
  18. Iterable
  19. Iterable
  20. IterableLike
  21. Equals
  22. Traversable
  23. Mutable
  24. Traversable
  25. GenericTraversableTemplate
  26. TraversableLike
  27. HasNewBuilder
  28. AnyRef
  29. Any

Type Members

  1. class WithFilter extends AnyRef

    A class supporting filtered operations

Value Members

  1. def &(that: Set[A]): Set[A]

    Computes the intersection between this set and another set

  2. def &~(that: Set[A]): Set[A]

    The difference of this set and another set

  3. def **(that: Set[A]): Set[A]

    This method is an alias for intersect

  4. def +(elem: A): SetProxy[A]

    Adds a single element to this collection and returns the collection itself

  5. def +(elem1: A, elem2: A, elems: A*): Set[A]

    Adds two or more elements to this collection and returns the collection itself

  6. def ++[B >: A, That](that: Iterator[B])(bf: CanBuildFrom[Set[A], B, That]): That

    Concatenates this mutable set with the elements of an iterator

  7. def ++[B >: A, That](that: Traversable[B])(bf: CanBuildFrom[Set[A], B, That]): That

    Concatenates this mutable set with the elements of a traversable collection

  8. def ++(iter: Iterator[A]): Set[A]

    Adds a number of elements provided by an iterator and returns the collection itself

  9. def ++(iter: Traversable[A]): Set[A]

    Adds a number of elements provided by a traversable object and returns either the collection itself

  10. def ++=(elems: Traversable[A]): Growable[A]

    adds all elements contained in a traversable collection to this mutable set

  11. def ++=(iter: Iterator[A]): Growable[A]

    adds all elements produced by an iterator to this mutable set

  12. def +=(elem: A): SetProxy[A]

    Adds a single element to the builder

  13. def +=(elem1: A, elem2: A, elems: A*): Growable[A]

    adds two or more elements to this mutable set

  14. def -(elem: A): SetProxy[A]

    Removes a single element from this collection and returns the collection itself

  15. def -(elem1: A, elem2: A, elems: A*): Set[A]

    Removes two or more elements from this collection and returns the collection itself

  16. def --(iter: Iterator[A]): Set[A]

    Removes a number of elements provided by an iterator and returns the collection itself

  17. def --(iter: Traversable[A]): Set[A]

    Removes a number of elements provided by a Traversable object and returns the collection itself

  18. def --=(iter: Traversable[A]): Shrinkable[A]

    Removes all elements contained in a traversable collection from this mutable set

  19. def --=(iter: Iterator[A]): Shrinkable[A]

    Removes all elements produced by an iterator from this mutable set

  20. def -=(elem: A): SetProxy[A]

    Removes a single element from this mutable set

  21. def -=(elem1: A, elem2: A, elems: A*): Shrinkable[A]

    Removes two or more elements from this mutable set

  22. def /:[B](z: B)(op: (B, A) ⇒ B): B

    Applies a binary operator to a start value and all elements of this mutable set, going left to right

  23. def :\[B](z: B)(op: (A, B) ⇒ B): B

    Applies a binary operator to all elements of this mutable set and a start value, going right to left

  24. def <<(cmd: Message[A]): Unit

    Send a message to this scriptable object

  25. def add(elem: A): Boolean

    Adds an element to this mutable set

  26. def addString(b: StringBuilder): StringBuilder

    Appends all elements of this mutable set to a string builder

  27. def addString(b: StringBuilder, sep: String): StringBuilder

    Appends all elements of this mutable set to a string builder using a separator string

  28. def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder

    Appends all elements of this mutable set to a string builder using start, end, and separator strings

  29. def andThen[A](g: (Boolean) ⇒ A): (A) ⇒ A

    (f andThen g)(x) == g(f(x))

  30. def apply(elem: A): Boolean

    Tests if some element is contained in this set

  31. def canEqual(that: Any): Boolean

    Method called from equality methods, so that user-defined subclasses can refuse to be equal to other collections of the same kind

  32. def clear(): Unit

    Removes all elements from the set

  33. def clone(): Set[A]

    This method creates and returns a copy of the receiver object

  34. def companion: GenericCompanion[Set[A][A]]

    The factory companion object that builds instances of class mutable

  35. def compose[A](g: (A) ⇒ A): (A) ⇒ Boolean

    (f compose g)(x) == f(g(x))

  36. def contains(elem: A): Boolean

    Tests if some element is contained in this set

  37. def copyToArray[B >: A](xs: Array[B], start: Int): Unit

    Copies elements of this mutable set to an array

  38. def copyToArray[B >: A](xs: Array[B], start: Int, len: Int): Unit

    Copies elements of this mutable set to an array

  39. def copyToArray[B >: A](xs: Array[B]): Unit

    Copies elements of this mutable set to an array

  40. def copyToBuffer[B >: A](dest: Buffer[B]): Unit

    Copies all elements of this mutable set to a buffer

  41. def count(p: (A) ⇒ Boolean): Int

    Counts the number of elements in the mutable set which satisfy a predicate

  42. def diff(that: Set[A]): Set[A]

    Computes the difference of this set and another set

  43. def drop(n: Int): Set[A]

    Selects all elements except first n ones

  44. def dropRight(n: Int): Set[A]

    Selects all elements except first n ones

  45. def dropWhile(p: (A) ⇒ Boolean): Set[A]

    Drops longest prefix of elements that satisfy a predicate

  46. def elements: Iterator[A]

  47. def empty: SetProxy[A]

  48. def equals(that: Any): Boolean

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence

  49. def exists(p: (A) ⇒ Boolean): Boolean

    Tests whether a predicate holds for some of the elements of this mutable set

  50. def filter(p: (A) ⇒ Boolean): Set[A]

    Selects all elements of this mutable set which satisfy a predicate

  51. def filterNot(p: (A) ⇒ Boolean): Set[A]

    Selects all elements of this mutable set which do not satisfy a predicate

  52. def find(p: (A) ⇒ Boolean): Option[A]

    Finds the first element of the mutable set satisfying a predicate, if any

  53. def first: A

  54. def firstOption: Option[A]

    None if iterable is empty

  55. def flatMap[B, That](f: (A) ⇒ Traversable[B])(bf: CanBuildFrom[Set[A], B, That]): That

    Builds a new collection by applying a function to all elements of this mutable set and concatenating the results

  56. def flatten[B](asTraversable: (A) ⇒ Traversable[B]): Set[B]

    Converts this mutable set of traversable collections into a mutable set in which all element collections are concatenated

  57. def foldLeft[B](z: B)(op: (B, A) ⇒ B): B

    Applies a binary operator to a start value and all elements of this mutable set, going left to right

  58. def foldRight[B](z: B)(op: (A, B) ⇒ B): B

    Applies a binary operator to all elements of this mutable set and a start value, going right to left

  59. def forall(p: (A) ⇒ Boolean): Boolean

    Tests whether a predicate holds for all elements of this mutable set

  60. def foreach[U](f: (A) ⇒ U): Unit

    Applies a function f to all elements of this mutable set

  61. def genericBuilder[B]: Builder[B, Set[B]]

    The generic builder that builds instances of mutable

  62. def groupBy[K](f: (A) ⇒ K): Map[K, Set[A]]

    Partitions this mutable set into a map of mutable sets according to some discriminator function

  63. def hasDefiniteSize: Boolean

    Tests whether this mutable set is known to have a finite size

  64. def hashCode(): Int

    Returns a hash code value for the object

  65. def head: A

    Selects the first element of this mutable set

  66. def headOption: Option[A]

    Optionally selects the first element

  67. def init: Set[A]

    Selects all elements except the last

  68. def intersect(that: Set[A]): Set[A]

    Computes the intersection between this set and another set

  69. def isEmpty: Boolean

    Tests whether this mutable set is empty

  70. def iterator: Iterator[A]

    Creates a new iterator over all elements contained in this iterable object

  71. def last: A

    Selects the last element

  72. def lastOption: Option[A]

    Optionally selects the last element

  73. def map[B, That](f: (A) ⇒ B)(bf: CanBuildFrom[Set[A], B, That]): That

    Builds a new collection by applying a function to all elements of this mutable set

  74. def mapResult[NewTo](f: (Set[A]) ⇒ NewTo): Builder[A, NewTo]

    Creates a new builder by applying a transformation function to the results of this builder

  75. def max[B >: A](cmp: Ordering[B]): A

    Finds the largest element

  76. def min[B >: A](cmp: Ordering[B]): A

    Finds the smallest element

  77. def mkString: String

    Displays all elements of this mutable set in a string

  78. def mkString(sep: String): String

    Displays all elements of this mutable set in a string using a separator string

  79. def mkString(start: String, sep: String, end: String): String

    Displays all elements of this mutable set in a string using start, end, and separator strings

  80. def nonEmpty: Boolean

    Tests whether the mutable set is not empty

  81. def partialMap[B, That](pf: PartialFunction[A, B])(bf: CanBuildFrom[Set[A], B, That]): That

    Builds a new collection by applying a partial function to all elements of this mutable set on which the function is defined

  82. def partition(p: (A) ⇒ Boolean): (Set[A], Set[A])

    Partitions this mutable set in two mutable sets according to a predicate

  83. def product[B >: A](num: Numeric[B]): B

    Multiplies up the elements of this collection

  84. def projection: IterableView[A, Set[A]]

    returns a projection that can be used to call non-strict filter,map, and flatMap methods that build projections of the collection

  85. def reduceLeft[B >: A](op: (B, A) ⇒ B): B

    Applies a binary operator to all elements of this mutable set, going left to right

  86. def reduceLeftOption[B >: A](op: (B, A) ⇒ B): Option[B]

    Optionally applies a binary operator to all elements of this mutable set, going left to right

  87. def reduceRight[B >: A](op: (A, B) ⇒ B): B

    Applies a binary operator to all elements of this mutable set, going right to left

  88. def reduceRightOption[B >: A](op: (A, B) ⇒ B): Option[B]

    Optionally applies a binary operator to all elements of this mutable set, going right to left

  89. def remove(elem: A): Boolean

    Removes an element from this set

  90. def repr: SetProxy[A]

    The representation object of type Repr which contains the collection's elements

  91. def result(): Set[A]

    The result when this set is used as a builder

  92. def retain(p: (A) ⇒ Boolean): Unit

    Removes all elements from the set for which do not satisfy a predicate

  93. def sameElements[B >: A](that: Iterable[B]): Boolean

    Checks if the other iterable collection contains the same elements in the same order as this mutable set

  94. def self: Set[A]

  95. def size: Int

    The size of this mutable set

  96. def sizeHint(size: Int): Unit

    Gives a hint how many elements are expected to be added when the next result is called

  97. def slice(from: Int, until: Int): Set[A]

    Selects an interval of elements

  98. def span(p: (A) ⇒ Boolean): (Set[A], Set[A])

    Spits this mutable set into a prefix/suffix pair according to a predicate

  99. def splitAt(n: Int): (Set[A], Set[A])

    Splits this mutable set into two at a given position

  100. def stringPrefix: String

    Defines the prefix of this object's toString representation

  101. def subsetOf(that: Set[A]): Boolean

    Tests whether this set is a subset of another set

  102. def sum[B >: A](num: Numeric[B]): B

    Sums up the elements of this collection

  103. def tail: Set[A]

    Selects all elements except the first

  104. def take(n: Int): Set[A]

    Selects first n elements

  105. def takeRight(n: Int): Set[A]

    Selects last n elements

  106. def takeWhile(p: (A) ⇒ Boolean): Set[A]

    Takes longest prefix of elements that satisfy a predicate

  107. def toArray[B >: A](arg0: ClassManifest[B]): Array[B]

    Converts this mutable set to an array

  108. def toIndexedSeq[B >: A]: IndexedSeq[B]

    Converts this mutable set to an indexed sequence

  109. def toIterable: Iterable[A]

    Converts this mutable set to an iterable collection

  110. def toList: List[A]

    Converts this mutable set to a list

  111. def toSeq: Seq[A]

    Converts this mutable set to a sequence

  112. def toSet[B >: A]: Set[B]

    Converts this mutable set to a set

  113. def toStream: Stream[A]

    Converts this mutable set to a stream

  114. def toString(): String

    Returns a string representation of the object

  115. def transpose[B](asTraversable: (A) ⇒ Traversable[B]): Set[Set[B]]

    Transposes this mutable set of traversable collections into

  116. def union(that: Set[A]): Set[A]

    Computes the union between of set and another set

  117. def unzip[A1, A2](asPair: (A) ⇒ (A1, A2)): (Set[A1], Set[A2])

    Converts this mutable set of pairs into two collections of the first and second halfs of each pair

  118. def update(elem: A, included: Boolean): Unit

    Updates the presence of a single element in this set

  119. def view(from: Int, until: Int): IterableView[A, Set[A]]

    Creates a non-strict view of a slice of this mutable set

  120. def view: IterableView[A, Set[A]]

    Creates a non-strict view of this mutable set

  121. def withFilter(p: (A) ⇒ Boolean): WithFilter

    Creates a non-strict filter of this mutable set

  122. def zip[A1 >: A, B, That](that: Iterable[B])(bf: CanBuildFrom[Set[A], (A1, B), That]): That

    Returns a mutable set formed from this mutable set and another iterable collection by combining corresponding elements in pairs

  123. def zipAll[B, A1 >: A, That](that: Iterable[B], thisElem: A1, thatElem: B)(bf: CanBuildFrom[Set[A], (A1, B), That]): That

    Returns a mutable set formed from this mutable set and another iterable collection by combining corresponding elements in pairs

  124. def zipWithIndex[A1 >: A, That](bf: CanBuildFrom[Set[A], (A1, Int), That]): That

    Zips this mutable set with its indices

  125. def |(that: Set[A]): Set[A]

    Computes the union between this set and another set