|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MapWithPreimages
An extension of the Map interface that provides efficient access to the pre-image of a value in the map. The pre-image of a value y is the set of keys that map to y.
Nested Class Summary | |
---|---|
static class |
MapWithPreimages.EmptyMapWithPreimages
|
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Field Summary | |
---|---|
static MapWithPreimages |
EMPTY_MAP_WITH_PREIMAGES
An empty MapWithPreimages. |
Method Summary | |
---|---|
java.util.Set |
getPreimage(java.lang.Object v)
Returns the set of keys that map to v . |
MultiMap |
getPreimages()
Returns a MultiMap view of the inverse of this map. |
boolean |
isCorefPair(java.lang.Object k1,
java.lang.Object k2)
Returns true if k1 and k2 are coreferent,
that is, they are both keys that map to the same value. |
int |
numCorefPairs()
Returns the number of two-element sets of objects {k1, k2} such that isCorefPair(k1, k2) returns true. |
java.util.Set |
valueSet()
Returns the set of values in the map. |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Field Detail |
---|
static final MapWithPreimages EMPTY_MAP_WITH_PREIMAGES
Method Detail |
---|
java.util.Set valueSet()
values
method in the Map
interface
in that it returns a Set rather than a Collection.
java.util.Set getPreimage(java.lang.Object v)
v
. If no keys
map to v
, this is the empty set.
MultiMap getPreimages()
boolean isCorefPair(java.lang.Object k1, java.lang.Object k2)
k1
and k2
are coreferent,
that is, they are both keys that map to the same value.
int numCorefPairs()
Note that this is different from computing the number of ordered pairs (k1, k2) such that isCorefPair(k1, k2) returns true; then we wouldn't divide by 2 in the formula above.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |