|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttip.util.EqualityMap<K,V>
K
- the type of the keysV
- the type of the valuespublic class EqualityMap<K,V>
EqualityMap
implements a Map
where equality of key elements
can be abstracted using an Equalitor
, i.e. key elements are in the
set are regarded as equal based on Equalitor.equals(Object, Object)
.
Constructor Summary | |
---|---|
EqualityMap()
Creates a new empty map using IdentityEqualitor as equalitor
on key elements. |
|
EqualityMap(Equalitor<K> equalitor)
Create a new empty map using equalitor as equalitor on key
elements. |
Method Summary | |
---|---|
void |
clear()
|
EqualityMap<K,V> |
clone()
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
Set<Map.Entry<K,V>> |
entrySet()
|
boolean |
equals(Object o)
|
V |
get(Object key)
|
Equalitor<K> |
getEqualitor()
Returns the Equalitor used for equality on key elements. |
int |
hashCode()
|
boolean |
isEmpty()
|
EqualitySet<K> |
keySet()
|
V |
put(K key,
V value)
|
void |
putAll(Map<? extends K,? extends V> t)
|
V |
remove(Object key)
|
int |
size()
|
String |
toString()
|
String |
toString(Collection<K> keySet,
Stringifier<K> keyStringifier,
Stringifier<V> valueStringifier)
Returns a text representation of a subset of the keys in the map using the keyStringifier and valueStringifier . |
String |
toString(Stringifier<K> keyStringifier,
Stringifier<V> valueStringifier)
Returns a text representation of the map using the keyStringifier
and valueStringifier . |
Collection<V> |
values()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EqualityMap()
IdentityEqualitor
as equalitor
on key elements.
public EqualityMap(Equalitor<K> equalitor)
equalitor
as equalitor on key
elements.
equalitor
- the Equalitor
used for equality on key elements
{@link
- IllegalArgumentException} if equalitor
is
null
Method Detail |
---|
public void clear()
clear
in interface Map<K,V>
public EqualityMap<K,V> clone()
clone
in class Object
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
public Set<Map.Entry<K,V>> entrySet()
entrySet
in interface Map<K,V>
public boolean equals(Object o)
equals
in interface Map<K,V>
equals
in class Object
public V get(Object key)
get
in interface Map<K,V>
public Equalitor<K> getEqualitor()
Equalitor
used for equality on key elements.
Equalitor
used for equality on key elementspublic int hashCode()
hashCode
in interface Map<K,V>
hashCode
in class Object
public boolean isEmpty()
isEmpty
in interface Map<K,V>
public EqualitySet<K> keySet()
keySet
in interface Map<K,V>
public V put(K key, V value)
put
in interface Map<K,V>
public void putAll(Map<? extends K,? extends V> t)
putAll
in interface Map<K,V>
public V remove(Object key)
remove
in interface Map<K,V>
public int size()
size
in interface Map<K,V>
public String toString()
toString
in class Object
public String toString(Stringifier<K> keyStringifier, Stringifier<V> valueStringifier)
keyStringifier
and valueStringifier
.
keyStringifier
- the Stringifier
used for key elementsvalueStringifier
- the Stringifier
used for values
public String toString(Collection<K> keySet, Stringifier<K> keyStringifier, Stringifier<V> valueStringifier)
keyStringifier
and valueStringifier
.
keyStringifier
- the Stringifier
used for key elementsvalueStringifier
- the Stringifier
used for values
public Collection<V> values()
values
in interface Map<K,V>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |