Trait that marks an O(1) bidirectional map between Ints (increasing from 0) and T's. This class is used, for example, to efficiently build unique vector space mappings for strings. The methods in this trait do not mutate the underlying index. Use either a MutableIndex or one of the companion object constructor methods to build an index.
- Companion:
- object
Value members
Abstract methods
Returns the int id of the given element (0-based) or -1 if not found in the index. This method never changes the index (even in MutableIndex).
Returns the int id of the given element (0-based) or -1 if not found in the index. This method never changes the index (even in MutableIndex).
Concrete methods
Returns true if this index contains the element t.
Returns true if this index contains the element t.
Returns an object at the given position or throws IndexOutOfBoundsException if it's not found.
Returns an object at the given position or throws IndexOutOfBoundsException if it's not found.
Override Iterable's linear-scan indexOf to use our apply method.
Override Iterable's linear-scan indexOf to use our apply method.
Inherited methods
- Inherited from:
- IterableOnceOps
- Inherited from:
- IterableOnceOps
- Inherited from:
- IterableOnceOps
Deprecated and Inherited methods
- Deprecated
[Since version 2.13.0]Use ++ instead of ++: for collections of type Iterable- Inherited from:
- IterableOps
- Deprecated
[Since version 2.13.0]Use foldLeft instead of /:- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]Use foldRight instead of :\\- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]`aggregate` is not relevant for sequential collections. Use `foldLeft(z)(seqop)` instead.- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]Use iterableFactory instead- Inherited from:
- IterableOps
- Deprecated
[Since version 2.13.0]Use `dest ++= coll` instead- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]Use coll instead of repr in a collection implementation, use the collection value itself from the outside- Inherited from:
- IterableOps
- Deprecated
[Since version 2.13.0]Iterable.seq always returns the iterable itself- Inherited from:
- Iterable
- Deprecated
[Since version 2.13.7]toIterable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections- Inherited from:
- Iterable
- Deprecated
[Since version 2.13.0]Use .iterator instead of .toIterator- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]Use .to(LazyList) instead of .toStream- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]toTraversable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections- Inherited from:
- IterableOps
- Deprecated
[Since version 2.13.0]Use .view.slice(from, until) instead of .view(from, until)- Inherited from:
- IterableOps