On this page
Class Searching.SearchResult
sealed abstract class SearchResult
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)
Supertypes | |
---|---|
Known subtypes |
Abstract methods
Source
def insertionPoint: Int
The index corresponding to the element searched for in the sequence, if it was found, or the index where the element would be inserted in the sequence, if it was not in the sequence
© 2002-2022 EPFL, with contributions from Lightbend.
Licensed under the Apache License, Version 2.0.
https://scala-lang.org/api/3.2.0/scala/collection/Searching$$SearchResult.html