FK
- the type of the keys in the underlying MapTK
- the type that the keys should be converted toFV
- the type of the values in the underlying MapTV
- the type that the values should be converted topublic static class ConverterCollections.ConverterMap<FK,TK,FV,TV> extends Object implements Map<TK,TV>, Serializable
Modifier and Type | Field | Description |
---|---|---|
protected Converter<TK,FK> |
m_convKeyDown |
The Converter used to pass keys down to the Map.
|
protected Converter<FK,TK> |
m_convKeyUp |
The Converter used to view keys stored in the Map.
|
protected Converter<TV,FV> |
m_convValDown |
The Converter used to pass keys down to the Map.
|
protected Converter<FV,TV> |
m_convValUp |
The Converter used to view values stored in the Map.
|
protected Map<FK,FV> |
m_map |
The underlying Map.
|
protected Set<Map.Entry<TK,TV>> |
m_set |
The Entry Set.
|
Constructor | Description |
---|---|
ConverterMap(Map<FK,FV> map,
Converter<FK,TK> convKeyUp,
Converter<TK,FK> convKeyDown,
Converter<FV,TV> convValUp,
Converter<TV,FV> convValDown) |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
void |
clear() |
|
boolean |
containsKey(Object key) |
|
boolean |
containsValue(Object value) |
|
Set<Map.Entry<TK,TV>> |
entrySet() |
|
boolean |
equals(Object o) |
|
TV |
get(Object key) |
|
Converter<TK,FK> |
getConverterKeyDown() |
Return the Converter used to pass keys down to the underlying Map.
|
Converter<FK,TK> |
getConverterKeyUp() |
Return the Converter used to view the underlying Map's keys
through.
|
Converter<TV,FV> |
getConverterValueDown() |
Return the Converter used to pass values down to the underlying
Map.
|
Converter<FV,TV> |
getConverterValueUp() |
Return the Converter used to view the underlying Map's values
through.
|
Map<FK,FV> |
getMap() |
Return the underlying Map.
|
int |
hashCode() |
|
protected <F,T> Collection<T> |
instantiateCollection(Collection<F> col,
Converter<F,T> convUp,
Converter<T,F> convDown) |
Create a Converter Collection.
|
protected Set<Map.Entry<TK,TV>> |
instantiateEntrySet(Set<Map.Entry<FK,FV>> set,
Converter<FK,TK> convKeyUp,
Converter<TK,FK> convKeyDown,
Converter<FV,TV> convValUp,
Converter<TV,FV> convValDown) |
Create a Converter Entry Set.
|
protected <FK,TK,FV,TV> |
instantiateMap(Map<FK,FV> map,
Converter<FK,TK> convKeyUp,
Converter<TK,FK> convKeyDown,
Converter<FV,TV> convValUp,
Converter<TV,FV> convValDown) |
Create a Converter Map.
|
protected <T,F> Set<T> |
instantiateSet(Set<F> set,
Converter<F,T> convUp,
Converter<T,F> convDown) |
Create a Converter Set.
|
boolean |
isEmpty() |
|
Set<TK> |
keySet() |
|
TV |
put(TK key,
TV value) |
|
void |
putAll(Map<? extends TK,? extends TV> map) |
|
TV |
remove(Object key) |
|
int |
size() |
|
Map<TK,TV> |
subMap(Set<TK> setKeys) |
|
String |
toString() |
|
Collection<TV> |
values() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
protected final Converter<FK,TK> m_convKeyUp
protected final Converter<TK,FK> m_convKeyDown
protected final Converter<FV,TV> m_convValUp
protected final Converter<TV,FV> m_convValDown
public ConverterMap(Map<FK,FV> map, Converter<FK,TK> convKeyUp, Converter<TK,FK> convKeyDown, Converter<FV,TV> convValUp, Converter<TV,FV> convValDown)
map
- the underlying MapconvKeyUp
- the Converter to view the underlying Map's keys
throughconvKeyDown
- the Converter to use to pass keys down to the
underlying MapconvValUp
- the Converter to view the underlying Map's
values throughconvValDown
- the Converter to use to pass values down to the
underlying Mappublic boolean containsKey(Object key)
containsKey
in interface Map<TK,TV>
public boolean containsValue(Object value)
containsValue
in interface Map<TK,TV>
public boolean equals(Object o)
public int hashCode()
protected <F,T> Collection<T> instantiateCollection(Collection<F> col, Converter<F,T> convUp, Converter<T,F> convDown)
F
- the type of elements in the underlying CollectionT
- the type that the elements should be converted tocol
- the underlying CollectionconvUp
- the Converter to view the underlying Collection
throughconvDown
- the Converter to pass items down to the underlying
Collection throughprotected <T,F> Set<T> instantiateSet(Set<F> set, Converter<F,T> convUp, Converter<T,F> convDown)
F
- the type of elements in the underlying SetT
- the type that the elements should be converted toset
- the underlying SetconvUp
- the Converter to view the underlying Set throughconvDown
- the Converter to pass items down to the underlying
Set throughprotected <FK,TK,FV,TV> Map<TK,TV> instantiateMap(Map<FK,FV> map, Converter<FK,TK> convKeyUp, Converter<TK,FK> convKeyDown, Converter<FV,TV> convValUp, Converter<TV,FV> convValDown)
FK
- the type of the keys in the underlying MapTK
- the type that the keys should be converted toFV
- the type of the values in the underlying MapTV
- the type that the values should be converted tomap
- the underlying MapconvKeyUp
- the Converter to view the underlying Map's keys
throughconvKeyDown
- the Converter to use to pass keys down to the
underlying MapconvValUp
- the Converter to view the underlying Map's
values throughconvValDown
- the Converter to use to pass values down to the
underlying Mapprotected Set<Map.Entry<TK,TV>> instantiateEntrySet(Set<Map.Entry<FK,FV>> set, Converter<FK,TK> convKeyUp, Converter<TK,FK> convKeyDown, Converter<FV,TV> convValUp, Converter<TV,FV> convValDown)
set
- the underlying Map Entry SetconvKeyUp
- the Converter to view the underlying Map's
Entry Set's keys throughconvKeyDown
- the Converter to use to pass keys down to the
underlying Map's Entry SetconvValUp
- the Converter to view the underlying Map's
Entry Set's values throughconvValDown
- the Converter to use to pass values down to the
underlying Map's Entry Setpublic Converter<FK,TK> getConverterKeyUp()
public Converter<TK,FK> getConverterKeyDown()
public Converter<FV,TV> getConverterValueUp()