Class MutableMapping<T>
java.lang.Object
com.ibm.wala.util.intset.MutableMapping<T>
- All Implemented Interfaces:
OrdinalSetMapping<T>
,Serializable
,Iterable<T>
- Direct Known Subclasses:
UnorderedDomain
A bit set mapping based on an object array. This is not terribly efficient, but is useful for
prototyping.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Add an object to the set of mapped objects.void
int
getMappedIndex
(@Nullable Object o) getMappedObject
(int n) int
int
getSize()
boolean
hasMappedIndex
(T o) iterator()
static <T> MutableMapping
<T> make()
makeSingleton
(int i) void
Add an object to the set of mapped objects at index i.void
Replace a in this mapping with b.stream()
Stream over mapped objects.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
MutableMapping
- Throws:
IllegalArgumentException
- if array is null
-
MutableMapping
protected MutableMapping()
-
-
Method Details
-
make
-
getMappedObject
- Specified by:
getMappedObject
in interfaceOrdinalSetMapping<T>
- Returns:
- the object numbered n.
-
getMappedIndex
- Specified by:
getMappedIndex
in interfaceOrdinalSetMapping<T>
- Returns:
- the number of a given object, or -1 if the object is not currently in the range.
-
hasMappedIndex
- Specified by:
hasMappedIndex
in interfaceOrdinalSetMapping<T>
- Returns:
- whether the given object is mapped by this mapping
-
add
Add an object to the set of mapped objects.- Specified by:
add
in interfaceOrdinalSetMapping<T>
- Returns:
- the integer to which the object is mapped.
-
toString
-
iterator
-
stream
Description copied from interface:OrdinalSetMapping
Stream over mapped objects.- Specified by:
stream
in interfaceOrdinalSetMapping<T>
- Returns:
- a stream over the mapped objects
-
makeSingleton
- See Also:
-
deleteMappedObject
-
getObjects
-
replace
Replace a in this mapping with b.- Throws:
IllegalArgumentException
-
put
Add an object to the set of mapped objects at index i. -
getMaximumIndex
public int getMaximumIndex()- Specified by:
getMaximumIndex
in interfaceOrdinalSetMapping<T>
- Returns:
- the maximum integer mapped to an object
-
getSize
public int getSize()- Specified by:
getSize
in interfaceOrdinalSetMapping<T>
- Returns:
- the current size of the bijection
-