Searching

scala.collection.Searching$
object Searching

Attributes

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

Members list

Concise view

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.

Attributes

foundIndex

the index corresponding to the element searched for in the sequence

Source:
Searching.scala
Graph
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any
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

Attributes

insertionPoint

the index where the element would be inserted in the sequence

Source:
Searching.scala
Graph
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any
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
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Deprecated classlikes

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

Attributes

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

Implicits

Deprecated implicits

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

Attributes

Deprecated
true
Source:
Searching.scala