Class OffsetOrdinalSetMapping<T>
java.lang.Object
com.ibm.wala.util.intset.OffsetOrdinalSetMapping<T>
- All Implemented Interfaces:
OrdinalSetMapping<T>, Iterable<T>
An ordinal set mapping, backed a delegate, but adding an offset to each index.
-
Method Summary
Modifier and TypeMethodDescriptionintAdd an Object to the set of mapped objects.intgetMappedObject(int n) intintgetSize()booleanhasMappedIndex(T o) iterator()static <T> OffsetOrdinalSetMapping<T> make(int offset) static <T> OffsetOrdinalSetMapping<T> make(OrdinalSetMapping<T> delegate, int offset) stream()Stream over mapped objects.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
getMaximumIndex
public int getMaximumIndex()- Specified by:
getMaximumIndexin interfaceOrdinalSetMapping<T>- Returns:
- the maximum integer mapped to an object
-
getSize
public int getSize()- Specified by:
getSizein interfaceOrdinalSetMapping<T>- Returns:
- the current size of the bijection
-
make
-
make
-
add
Description copied from interface:OrdinalSetMappingAdd an Object to the set of mapped objects.- Specified by:
addin interfaceOrdinalSetMapping<T>- Returns:
- the integer to which the object is mapped.
-
getMappedIndex
- Specified by:
getMappedIndexin interfaceOrdinalSetMapping<T>- Returns:
- the number of a given object, or -1 if the object is not currently in the range.
-
getMappedObject
- Specified by:
getMappedObjectin interfaceOrdinalSetMapping<T>- Returns:
- the object numbered n.
- Throws:
NoSuchElementException
-
hasMappedIndex
- Specified by:
hasMappedIndexin interfaceOrdinalSetMapping<T>- Returns:
- whether the given object is mapped by this mapping
-
iterator
-
stream
Description copied from interface:OrdinalSetMappingStream over mapped objects.- Specified by:
streamin interfaceOrdinalSetMapping<T>- Returns:
- a stream over the mapped objects
-