Returns the key/row pair at position i
.
Returns the key/row pair at position i
.
Returns an empty Index
with the same key type as this.
Returns an empty Index
with the same key type as this.
Iterate over all key/row pairs in traversal order, calling f
with each
pair for its side-effects.
Iterate over all key/row pairs in traversal order, calling f
with each
pair for its side-effects.
Returns the position of the first key/row pair with key k
.
Returns the position of the first key/row pair with key k
. If no key/row
pair with key k
exist in this index, then None
is returned.
the key to search for
Returns an index with just the key/row pairs whose key is k
.
Returns an index with just the key/row pairs whose key is k
. If there
are no such pairs, then an empty index is returned.
the key of the key/row pairs returned
Returns the row at position i
.
Returns the row at position i
.
Returns true
if this index is in sorted order.
Returns true
if this index is in sorted order.
Returns an iterator, in traversal order, over the key/row pairs in this index.
Returns an iterator, in traversal order, over the key/row pairs in this index.
Returns the key at position i
.
Returns the key at position i
.
Returns a copy of this Index, but whose rows have been replaced with their index in the traversal order instead.
Returns a copy of this Index, but whose rows have been replaced with their index in the traversal order instead. For example,
val index = Index("b" -> 32, "c" -> 9, "a" -> -23) assert(index.resetIndices == Index("b" -> 0, "c" -> 1, "a" -> 2))
Returns an index whose traversal order is the reverse of this one's.
Returns an index whose traversal order is the reverse of this one's.
(Changed in version 2.9.0) The behavior of scanRight
has changed. The previous behavior can be reproduced with scanRight.reverse.
Returns the index (in traversal order) of the first key/row pair whose key
is k
.
Returns the index (in traversal order) of the first key/row pair whose key
is k
. If no such key exist in this index, then the this returns
-i - 1
, where i
is the position in the index where k
could be
inserted while still maintaining sorted order.
the key to search for
Returns the number of key/row pairs in this index.
Returns the number of key/row pairs in this index.
Returns this Index in sorted order, by its keys.
(Changed in version 2.9.0) transpose
throws an IllegalArgumentException
if collections are not uniformly sized.
Returns 2 arrays that match the key/row pairings, in traversal order.
Returns 2 arrays that match the key/row pairings, in traversal order. Namely, the following invariant should hold:
val index: Index[K] = ... val (keys, indices) = index.unzip val copy = Index(keys, indices) assert(index == copy)
(unorderedIndex: MonadOps[(K, Int)]).filter(p)
(unorderedIndex: MonadOps[(K, Int)]).flatMap(f)
(unorderedIndex: MonadOps[(K, Int)]).map(f)
(unorderedIndex: MonadOps[(K, Int)]).withFilter(p)