Interface Indexer<E>

Type Parameters:
E - type of objects to be indexed
All Superinterfaces:
Serializable
All Known Subinterfaces:
ClassHierarchy, HeapModel, IR
All Known Implementing Classes:
AbstractHeapModel, AllocationSiteBasedModel, CFGNodeIndexer, ClassHierarchyImpl, DefaultIR, NodeManager, ObjectFlowGraph, SimpleIndexer

public interface Indexer<E> extends Serializable
An indexer assigns each object a unique index, so that the objects can be stored in efficient data structures. Symmetrically, an indexer can map an index to the corresponding object.

Note that each object in the same indexer has a unique index, but different indexers may map different objects (indexes) to the same index (object), so it should be used with care.

The objects in an indexer i should preserve the invariant: e.equals(i.getObject(i.getIndex(e))).

  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    getObject(int index)
     
  • Method Details

    • getIndex

      int getIndex(E o)
      Returns:
      the index of the given object.
    • getObject

      E getObject(int index)
      Returns:
      the corresponding object of the given index.