Package com.ibm.wala.util.intset
Interface OrdinalSetMapping<T>
- All Superinterfaces:
Iterable<T>
- All Known Implementing Classes:
MutableMapping,ObjectArrayMapping,OffsetOrdinalSetMapping
An object that implements a bijection between whole numbers and objects.
-
Method Summary
Modifier and TypeMethodDescriptionintAdd an Object to the set of mapped objects.intgetMappedObject(int n) intintgetSize()booleanhasMappedIndex(T o) Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
getMappedObject
- Returns:
- the object numbered n.
- Throws:
NoSuchElementException
-
getMappedIndex
- Returns:
- the number of a given object, or -1 if the object is not currently in the range.
-
hasMappedIndex
- Returns:
- whether the given object is mapped by this mapping
-
getMaximumIndex
int getMaximumIndex()- Returns:
- the maximum integer mapped to an object
-
getSize
int getSize()- Returns:
- the current size of the bijection
-
add
Add an Object to the set of mapped objects.- Returns:
- the integer to which the object is mapped.
-