Package pascal.taie.util
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
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
-
Method Details
-
getIndex
- Returns:
- the index of the given object.
-
getObject
- Returns:
- the corresponding object of the given index.
-