Searching

scala.collection.Searching
object Searching

Attributes

Source
Searching.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Searching.type

Members list

Type members

Classlikes

case class Found(foundIndex: Int) extends SearchResult

The result of performing a search on a sorted sequence, where the element was found.

The result of performing a search on a sorted sequence, where the element was found.

Value parameters

foundIndex

the index corresponding to the element searched for in the sequence

Attributes

Source
Searching.scala
Supertypes
trait Serializable
trait Product
trait Equals
class SearchResult
class Object
trait Matchable
class Any
Show all
case class InsertionPoint(insertionPoint: Int) extends SearchResult

The result of performing a search on a sorted sequence, where the element was not found

The result of performing a search on a sorted sequence, where the element was not found

Value parameters

insertionPoint

the index where the element would be inserted in the sequence

Attributes

Source
Searching.scala
Supertypes
trait Serializable
trait Product
trait Equals
class SearchResult
class Object
trait Matchable
class Any
Show all
sealed abstract class SearchResult

The result of performing a search on a sorted sequence

The result of performing a search on a sorted sequence

Example usage:

val list = List(1, 3, 4, 5) // list must be sorted before searching
list.search(4) // Found(2)
list.search(2) // InsertionPoint(1)

Attributes

Source
Searching.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Found

Deprecated classlikes

final class SearchImpl[Repr, A](coll: SeqOps[A, AnyConstr, _]) extends AnyVal

Attributes

Deprecated
true
Source
Searching.scala
Supertypes
class AnyVal
trait Matchable
class Any

Implicits

Deprecated implicits

implicit def search[Repr, A](coll: Repr)(implicit fr: IsSeq[Repr]): SearchImpl[Repr, fr.A]

Attributes

Deprecated
true
Source
Searching.scala