Packages

  • package root

    This is the documentation for the Scala standard library.

    This is the documentation for the Scala standard library.

    Package structure

    The scala package contains core types like Int, Float, Array or Option which are accessible in all Scala compilation units without explicit qualification or imports.

    Notable packages include:

    Other packages exist. See the complete list on the right.

    Additional parts of the standard library are shipped as separate libraries. These include:

    • scala.reflect - Scala's reflection API (scala-reflect.jar)
    • scala.xml - XML parsing, manipulation, and serialization (scala-xml.jar)
    • scala.collection.parallel - Parallel collections (scala-parallel-collections.jar)
    • scala.util.parsing - Parser combinators (scala-parser-combinators.jar)
    • scala.swing - A convenient wrapper around Java's GUI framework called Swing (scala-swing.jar)

    Automatic imports

    Identifiers in the scala package and the scala.Predef object are always in scope by default.

    Some of these identifiers are type aliases provided as shortcuts to commonly used classes. For example, List is an alias for scala.collection.immutable.List.

    Other aliases refer to classes provided by the underlying platform. For example, on the JVM, String is an alias for java.lang.String.

    Definition Classes
    root
  • package scala

    Core Scala types.

    Core Scala types. They are always available without an explicit import.

    Definition Classes
    root
  • package collection
    Definition Classes
    scala
  • object MapOps
    Definition Classes
    collection
  • WithFilter

class WithFilter[K, +V, +IterableCC[_], +CC[_, _] <: IterableOps[_, AnyConstr, _]] extends IterableOps.WithFilter[(K, V), IterableCC] with Serializable

Specializes WithFilter for Map collection types by adding overloads to transformation operations that can return a Map.

Annotations
@SerialVersionUID()
Source
Map.scala
Linear Supertypes
IterableOps.WithFilter[(K, V), IterableCC], collection.WithFilter[(K, V), IterableCC], java.io.Serializable, AnyRef, Any
Known Subclasses
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. WithFilter
  2. WithFilter
  3. WithFilter
  4. Serializable
  5. AnyRef
  6. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new WithFilter(self: MapOps[K, V, CC, _] with IterableOps[(K, V), IterableCC, _], p: ((K, V)) => Boolean)

Value Members

  1. def flatMap[K2, V2](f: ((K, V)) => IterableOnce[(K2, V2)]): CC[K2, V2]
  2. def flatMap[B](f: ((K, V)) => IterableOnce[B]): IterableCC[B]

    Builds a new collection by applying a function to all elements of the filtered outer collection containing this WithFilter instance that satisfy

    Builds a new collection by applying a function to all elements of the filtered outer collection containing this WithFilter instance that satisfy

    B

    the element type of the returned collection.

    f

    the function to apply to each element.

    returns

    a new collection resulting from applying the given collection-valued function f to each element of the filtered outer collection and concatenating the results.

    Definition Classes
    WithFilterWithFilter
  3. def foreach[U](f: ((K, V)) => U): Unit

    Applies a function f to all elements of the filtered outer collection.

    Applies a function f to all elements of the filtered outer collection.

    U

    the type parameter describing the result of function f. This result will always be ignored. Typically U is Unit, but this is not necessary.

    f

    the function that is applied for its side-effect to every element. The result of function f is discarded.

    Definition Classes
    WithFilterWithFilter
  4. def map[K2, V2](f: ((K, V)) => (K2, V2)): CC[K2, V2]
  5. def map[B](f: ((K, V)) => B): IterableCC[B]

    Builds a new collection by applying a function to all elements of the filtered outer collection.

    Builds a new collection by applying a function to all elements of the filtered outer collection.

    B

    the element type of the returned collection.

    f

    the function to apply to each element.

    returns

    a new collection resulting from applying the given function f to each element of the filtered outer collection and collecting the results.

    Definition Classes
    WithFilterWithFilter
  6. def withFilter(q: ((K, V)) => Boolean): WithFilter[K, V, IterableCC, CC]

    Further refines the filter for this filtered map collection.

    Further refines the filter for this filtered map collection.

    q

    the predicate used to test elements.

    returns

    an object of class WithFilter, which supports map, flatMap, foreach, and withFilter operations. All these operations apply to those elements of this map collection which also satisfy both p and q predicates.

    Definition Classes
    WithFilterWithFilterWithFilter