public class MutableMapping<T> extends Object implements OrdinalSetMapping<T>, Serializable
| Modifier | Constructor and Description |
|---|---|
protected |
MutableMapping() |
|
MutableMapping(Object[] array) |
| Modifier and Type | Method and Description |
|---|---|
int |
add(T o)
Add an object to the set of mapped objects.
|
void |
deleteMappedObject(T n) |
int |
getMappedIndex(Object o) |
T |
getMappedObject(int n) |
int |
getMaximumIndex() |
Collection<T> |
getObjects() |
int |
getSize() |
boolean |
hasMappedIndex(T o) |
Iterator<T> |
iterator() |
static <T> MutableMapping<T> |
make() |
OrdinalSet<T> |
makeSingleton(int i) |
void |
put(int i,
T o)
Add an object to the set of mapped objects at index i.
|
void |
replace(T a,
T b)
Replace a in this mapping with b.
|
Stream<T> |
stream()
Stream over mapped objects.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic MutableMapping(Object[] array)
IllegalArgumentException - if array is nullprotected MutableMapping()
public static <T> MutableMapping<T> make()
public T getMappedObject(int n)
getMappedObject in interface OrdinalSetMapping<T>public int getMappedIndex(Object o)
getMappedIndex in interface OrdinalSetMapping<T>public boolean hasMappedIndex(T o)
hasMappedIndex in interface OrdinalSetMapping<T>public int add(T o)
add in interface OrdinalSetMapping<T>public Iterator<T> iterator()
iterator in interface Iterable<T>Iterable.iterator()public Stream<T> stream()
OrdinalSetMappingstream in interface OrdinalSetMapping<T>public OrdinalSet<T> makeSingleton(int i)
SparseIntSet.singleton(int)public void deleteMappedObject(T n)
public Collection<T> getObjects()
public void replace(T a, T b) throws IllegalArgumentException
IllegalArgumentExceptionpublic void put(int i,
T o)
public int getMaximumIndex()
getMaximumIndex in interface OrdinalSetMapping<T>public int getSize()
getSize in interface OrdinalSetMapping<T>