|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Map2<X,Y,V>
Map2 is an interface that represents a two-parameter map.
Copyright: This is public domain; The right of people to use, distribute, copy or improve the contents of the following may not be restricted.
Company: My Java Tools
Nested Class Summary | |
---|---|
static interface |
Map2.Entry<X,Y,V>
A map entry (key1-key2-value pair). |
Method Summary | |
---|---|
void |
clear()
Removes all mappings from this map. |
boolean |
containsKeyPair(java.lang.Object key1,
java.lang.Object key2)
Returns true if this map contains a mapping for the
specified key pair. |
java.util.Map<Y,V> |
curry1(X key1)
Currying by first argument. |
java.util.Map<X,V> |
curry2(Y key2)
Currying by second argument. |
java.util.Set<Map2.Entry<X,Y,V>> |
entrySet()
Returns a set view of the mappings contained in this map. |
V |
get(X key1,
Y key2)
Returns the value to which this map maps the specified key pair, and null if the map contains no mapping for these keys. |
boolean |
isEmpty()
|
java.util.Set<X> |
keySet1()
A Map2 has two sets of keys, first component and second component. |
java.util.Set<Y> |
keySet2()
A Map2 has two sets of keys, first component and second component. |
V |
put(X key1,
Y key2,
V value)
Associates the specified value with the specified key pair. |
void |
putAll(Map2<? extends X,? extends Y,? extends V> t)
Copies all of the mappings from the specified map to this map. |
V |
remove(X key1,
Y key2)
Removes the mapping for this key pair from this map if it is present. |
int |
size()
|
java.util.Collection<V> |
values()
Returns a collection view of the values contained in this map. |
Method Detail |
---|
int size()
boolean isEmpty()
true
if this map contains no key-value mappings.boolean containsKeyPair(java.lang.Object key1, java.lang.Object key2)
true
if this map contains a mapping for the
specified key pair.
key1
- first key.key2
- second key.
true if this map contains a mapping for this
key pair.
V get(X key1, Y key2)
null
if the map contains no mapping for these keys.
key1
- first key.key2
- second key.
null
if the map contains no mapping for these keys.
java.lang.ClassCastException
- if the key is of an inappropriate type for
this map (optional).
java.lang.NullPointerException
- if the key is null
and this map
does not permit null keys (optional).#containsKey(Object)
V put(X key1, Y key2, V value)
key1
- first key.key2
- second key.value
- value to be associated with the specified key pair.
null
if there was no mapping for key.V remove(X key1, Y key2)
Returns the value to which the map previously associated the keys, or null if the map contained no mapping for this key pair.
key1
- first key.key2
- second key.
void putAll(Map2<? extends X,? extends Y,? extends V> t)
source
- Mappings to be stored in this map.void clear()
java.util.Set<X> keySet1()
java.util.Set<Y> keySet2()
java.util.Collection<V> values()
java.util.Map<Y,V> curry1(X key1)
key1
- X
java.util.Map<X,V> curry2(Y key2)
key2
- X
java.util.Set<Map2.Entry<X,Y,V>> entrySet()
Map2.Entry
. The set is backed by the
map, so changes to the map are reflected in the set, and vice-versa.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |