Documentation of 'edu.uci.ics.jung.algorithms.util.Indexer' Java class
Indexer
edu.uci.ics.jung.algorithms.util

Class Indexer



  • public class Indexer
    extends java.lang.Object
    A class providing static methods useful for improving the performance of graph algorithms.
    • Constructor Summary

      Constructors 
      Constructor and Description
      Indexer() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static <T> com.google.common.collect.BiMap<T,java.lang.Integer> create(java.util.Collection<T> collection)
      Returns a BiMap mapping each element of the collection to its index as encountered while iterating over the collection.
      static <T> com.google.common.collect.BiMap<T,java.lang.Integer> create(java.util.Collection<T> collection, int start)
      Returns a BiMap mapping each element of the collection to its index as encountered while iterating over the collection.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Indexer

        public Indexer()
    • Method Detail

      • create

        public static <T> com.google.common.collect.BiMap<T,java.lang.Integer> create(java.util.Collection<T> collection)
        Returns a BiMap 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
        Type Parameters:
        T - the type of the collection elements
        Parameters:
        collection - the collection whose indices are to be generated
        Returns:
        a bidirectional map from collection elements to 0-based indices
      • create

        public static <T> com.google.common.collect.BiMap<T,java.lang.Integer> create(java.util.Collection<T> collection,
                                                                                      int start)
        Returns a BiMap 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
        Type Parameters:
        T - the type of the collection elements
        Parameters:
        collection - the collection whose indices are to be generated
        start - start index
        Returns:
        a bidirectional map from collection elements to start-based indices

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.