Movatterモバイル変換


[0]ホーム

URL:


Scala 3
3.7.4
LearnInstallPlaygroundFind A LibraryCommunityBlog
Scala 3
LearnInstallPlaygroundFind A LibraryCommunityBlog
DocsAPI
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
Scala 3/scala/scala.collection/WithFilter

WithFilter

scala.collection.WithFilter
abstractclassWithFilter[+A,+CC[_]] extendsSerializable

A template trait that contains just themap,flatMap,foreach andwithFilter methods of traitIterable.

Type parameters

A

Element type (e.g.Int)

CC

Collection type constructor (e.g.List)

Attributes

Source
WithFilter.scala
Graph
Supertypes
classObject
traitMatchable
classAny
Known subtypes
classWithFilter[A,CC]
classWithFilter[K,V,IterableCC,CC]
classWithFilter[K,V,IterableCC,MapCC,CC]
classWithFilter[A,IterableCC,CC]

Members list

Value members

Abstract methods

defflatMap[B](f:A=>IterableOnce[B]):CC[B]

Builds a new collection by applying a function to all elements of thefiltered outer collection containing thisWithFilter instance that satisfy

Builds a new collection by applying a function to all elements of thefiltered outer collection containing thisWithFilter instance that satisfy

Type parameters

B

the element type of the returned collection.

Value parameters

f

the function to apply to each element.

Attributes

Returns

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

Source
WithFilter.scala
defforeach[U](f:A=>U):Unit

Applies a functionf to all elements of thefiltered outer collection.

Applies a functionf to all elements of thefiltered outer collection.

Type parameters

U

the type parameter describing the result of functionf. This result will always be ignored. TypicallyU isUnit, but this is not necessary.

Value parameters

f

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

Attributes

Source
WithFilter.scala
defmap[B](f:A=>B):CC[B]

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

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

Type parameters

B

the element type of the returned collection.

Value parameters

f

the function to apply to each element.

Attributes

Returns

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

Source
WithFilter.scala

Further refines the filter for thisfiltered collection.

Further refines the filter for thisfiltered collection.

Value parameters

q

the predicate used to test elements.

Attributes

Returns

an object of classWithFilter, which supportsmap,flatMap,foreach, andwithFilter operations. All these operations apply to those elements of this collection which also satisfy bothp andq predicates.

Source
WithFilter.scala
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp