/** * Returns a <code>BiMap</code> 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) <code>indexOf(element)</code> method of a <code>List</code> * * @param <T> the type of the collection elements * @param collection the collection whose indices are to be generated * @return a bidirectional map from collection elements to 0-based indices */ public static <T> BiMap<T, Integer> create(Collection<T> collection) { return create(collection, 0); } /**
/** * Returns a <code>BidiMap</code> 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) <code>indexOf(element)</code> method of a <code>List</code> * * @param <T> * @param collection * @return a bidirectional map from collection elements to 0-based indices */ public static <T> BidiMap<T, Integer> create(Collection<T> collection) { return create(collection, 0); }
/** * Returns a <code>BiMap</code> 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) <code>indexOf(element)</code> method of a <code>List</code> * @param <T> the type of the collection elements * @param collection the collection whose indices are to be generated * @return a bidirectional map from collection elements to 0-based indices */ public static <T> BiMap<T,Integer> create(Collection<T> collection) { return create(collection, 0); } /**
/** * Returns a <code>BidiMap</code> 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) <code>indexOf(element)</code> method of a <code>List</code> * @param <T> * @param collection * @return a bidirectional map from collection elements to 0-based indices */ public static <T> BidiMap<T,Integer> create(Collection<T> collection) { return create(collection, 0); } /**