public class Indexer
extends java.lang.Object
Constructor and Description |
---|
Indexer() |
Modifier and Type | Method and Description |
---|---|
static <T> org.apache.commons.collections4.BidiMap<T,java.lang.Integer> |
create(java.util.Collection<T> collection)
Returns a
BidiMap mapping each element of the collection to its
index as encountered while iterating over the collection. |
static <T> org.apache.commons.collections4.BidiMap<T,java.lang.Integer> |
create(java.util.Collection<T> collection,
int start)
Returns a
BidiMap mapping each element of the collection to its
index as encountered while iterating over the collection. |
public static <T> org.apache.commons.collections4.BidiMap<T,java.lang.Integer> create(java.util.Collection<T> collection)
BidiMap
mapping each element of the collection to its
index as encountered while iterating over the collection. The purpose
of the index operation is to supply an O(1) replacement operation for the
O(n) indexOf(element)
method of a List
T
- collection
- public static <T> org.apache.commons.collections4.BidiMap<T,java.lang.Integer> create(java.util.Collection<T> collection, int start)
BidiMap
mapping each element of the collection to its
index as encountered while iterating over the collection. The purpose
of the index operation is to supply an O(1) replacement operation for the
O(n) indexOf(element)
method of a List
T
- collection
- start
- start index