Scala Library: scala.collection.generic.Shrinkable
scala.collection.generic.Shrinkable
trait Shrinkable[-A] extends AnyRef
This trait forms part of collections that can be reduced using a -=
operator.
- Source
- Version
- 2.8
- Since
- 2.8
Abstract Value Members From scala.collection.generic.Shrinkable
abstract def -=(elem: A): Shrinkable.this.type
Removes a single element from this shrinkable collection.
- elem
- the element to remove.
- returns
- the shrinkable collection itself
(defined at scala.collection.generic.Shrinkable)
Concrete Value Members From scala.collection.generic.Shrinkable
def --=(xs: TraversableOnce[A]): Shrinkable.this.type
Removes all elements produced by an iterator from this shrinkable collection.
- xs
- the iterator producing the elements to remove.
- returns
- the shrinkable collection itself
(defined at scala.collection.generic.Shrinkable)
def -=(elem1: A, elem2: A, elems: A*): Shrinkable.this.type
Removes two or more elements from this shrinkable collection.
- elem1
- the first element to remove.
- elem2
- the second element to remove.
- elems
- the remaining elements to remove.
- returns
- the shrinkable collection itself (defined at scala.collection.generic.Shrinkable)
Full Source:
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
package scala
package collection
package generic
/** This trait forms part of collections that can be reduced
* using a `-=` operator.
*
* @author Martin Odersky
* @version 2.8
* @since 2.8
* @define coll shrinkable collection
* @define Coll `Shrinkable`
*/
trait Shrinkable[-A] {
/** Removes a single element from this $coll.
*
* @param elem the element to remove.
* @return the $coll itself
*/
def -=(elem: A): this.type
/** Removes two or more elements from this $coll.
*
* @param elem1 the first element to remove.
* @param elem2 the second element to remove.
* @param elems the remaining elements to remove.
* @return the $coll itself
*/
def -=(elem1: A, elem2: A, elems: A*): this.type = {
this -= elem1
this -= elem2
this --= elems
}
/** Removes all elements produced by an iterator from this $coll.
*
* @param xs the iterator producing the elements to remove.
* @return the $coll itself
*/
def --=(xs: TraversableOnce[A]): this.type = { xs foreach -= ; this }
}
Interested in Scala?
I send out weekly, personalized emails with articles and conference talks.
Subscribe now.