scala.collection

SortedSetLike

trait SortedSetLike[A, +This <: SortedSet[A] with SortedSetLike[A, This]] extends Sorted[A, This] with SetLike[A, This]

A template for sets which are sorted.

known subclasses: SortedSet, SortedSet, TreeSet

Inherits

  1. SetLike
  2. Subtractable
  3. Addable
  4. IterableLike
  5. TraversableLike
  6. HasNewBuilder
  7. Equals
  8. Sorted
  9. AnyRef
  10. Any

Type Members

  1. class WithFilter extends AnyRef

    A class supporting filtered operations

Value Members

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

    Computes the intersection between this set and another set

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

    The difference of this set and another set

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

    This method is an alias for intersect

  4. def +(elem1: A, elem2: A, elems: A*): This

    Creates a new set with additional elements

  5. def +(elem: A): This

    Creates a new set with an additional element, unless the element is already present

  6. def ++(iter: Iterator[A]): This

    Creates a new set by adding all elements produced by an iterator to this set

  7. def ++(elems: Traversable[A]): This

    Creates a new set by adding all elements contained in another collection to this set

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

    Concatenates this set with the elements of an iterator

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

    Concatenates this set with the elements of a traversable collection

  10. def -(elem1: A, elem2: A, elems: A*): This

    Creates a new set from this set with some elements removed

  11. def -(elem: A): This

    Creates a new set with a given element removed from this set

  12. def --(iter: Iterator[A]): This

    Creates a new set from this set by removing all elements produced by an iterator

  13. def --(elems: Traversable[A]): This

    Creates a new set from this set by removing all elements of another collection

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

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

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

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

  16. def addString(b: StringBuilder): StringBuilder

    Appends all elements of this set to a string builder

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

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

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

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

  19. def apply(elem: A): Boolean

    Tests if some element is contained in this set

  20. 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

  21. def compare(k0: A, k1: A): Int

    Comparison function that orders keys

  22. def contains(elem: A): Boolean

    Tests if some element is contained in this set

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

    Copies elements of this set to an array

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

    Copies elements of this set to an array

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

    Copies elements of this set to an array

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

    Copies all elements of this set to a buffer

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

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

  28. def diff(that: Set[A]): This

    Computes the difference of this set and another set

  29. def drop(n: Int): This

    Selects all elements except first n ones

  30. def dropRight(n: Int): This

    Selects all elements except first n ones

  31. def dropWhile(p: (A) ⇒ Boolean): This

    Drops longest prefix of elements that satisfy a predicate

  32. def elements: Iterator[A]

  33. def empty: This

  34. def equals(that: Any): Boolean

    Compares this set with another object for equality

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

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

  36. def filter(p: (A) ⇒ Boolean): This

    Selects all elements of this set which satisfy a predicate

  37. def filterNot(p: (A) ⇒ Boolean): This

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

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

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

  39. def first: A

  40. def firstKey: A

    Returns the first key of the collection

  41. def firstOption: Option[A]

    None if iterable is empty

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

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

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

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

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

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

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

    Tests whether a predicate holds for all elements of this set

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

    Applies a function f to all elements of this set

  47. def from(from: A): This

    Creates a ranged projection of this collection with no upper-bound

  48. def groupBy[K](f: (A) ⇒ K): Map[K, This]

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

  49. def hasDefiniteSize: Boolean

    Tests whether this set is known to have a finite size

  50. def hashCode(): Int

    Returns a hash code value for the object

  51. def head: A

    Selects the first element of this set

  52. def headOption: Option[A]

    Optionally selects the first element

  53. def init: This

    Selects all elements except the last

  54. def intersect(that: Set[A]): This

    Computes the intersection between this set and another set

  55. def isEmpty: Boolean

    Tests if this set is empty

  56. def iterator: Iterator[A]

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

  57. def keySet: This

    return as a projection the set of keys in this collection

  58. def last: A

    Selects the last element

  59. def lastKey: A

    Returns the last key of the collection

  60. def lastOption: Option[A]

    Optionally selects the last element

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

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

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

    Finds the largest element

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

    Finds the smallest element

  64. def mkString: String

    Displays all elements of this set in a string

  65. def mkString(sep: String): String

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

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

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

  67. def nonEmpty: Boolean

    Tests whether the set is not empty

  68. def ordering: Ordering[A]

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

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

  70. def partition(p: (A) ⇒ Boolean): (This, This)

    Partitions this set in two sets according to a predicate

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

    Multiplies up the elements of this collection

  72. def projection: IterableView[A, This]

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

  73. def range(from: A, until: A): This

    Creates a ranged projection of this collection with both a lower-bound and an upper-bound

  74. def rangeImpl(from: Option[A], until: Option[A]): This

    Creates a ranged projection of this collection

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

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

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

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

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

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

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

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

  79. def repr: This

    The collection of type set underlying this TraversableLike object

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

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

  81. def size: Int

    The size of this set

  82. def slice(from: Int, until: Int): This

    Selects an interval of elements

  83. def span(p: (A) ⇒ Boolean): (This, This)

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

  84. def splitAt(n: Int): (This, This)

    Splits this set into two at a given position

  85. def stringPrefix: String

    Defines the prefix of this object's toString representation

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

    Tests whether this set is a subset of another set

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

    Sums up the elements of this collection

  88. def tail: This

    Selects all elements except the first

  89. def take(n: Int): This

    Selects first n elements

  90. def takeRight(n: Int): This

    Selects last n elements

  91. def takeWhile(p: (A) ⇒ Boolean): This

    Takes longest prefix of elements that satisfy a predicate

  92. def to(to: A): This

    Create a range projection of this collection with no lower-bound

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

    Converts this set to an array

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

    Converts this set to an indexed sequence

  95. def toIterable: Iterable[A]

    Converts this set to an iterable collection

  96. def toList: List[A]

    Converts this set to a list

  97. def toSeq: Seq[A]

    Converts this set to a sequence

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

    Converts this set to a set

  99. def toStream: Stream[A]

    Converts this set to a stream

  100. def toString(): String

    Converts this set to a string

  101. def union(that: Set[A]): This

    Computes the union between of set and another set

  102. def until(until: A): This

    Creates a ranged projection of this collection with no lower-bound

  103. def view(from: Int, until: Int): IterableView[A, This]

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

  104. def view: IterableView[A, This]

    Creates a non-strict view of this set

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

    Creates a non-strict filter of this set

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

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

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

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

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

    Zips this set with its indices

  109. def |(that: Set[A]): This

    Computes the union between this set and another set