Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


com.tangosol.util
Class ConverterCollections.ConverterMap

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.ConverterCollections.ConverterMap

All Implemented Interfaces:
java.io.Serializable, java.util.Map
Direct Known Subclasses:
CacheStoreMap, ConverterCollections.ConverterConcurrentMap, ConverterCollections.ConverterInvocableMap, ConverterCollections.ConverterObservableMap, ConverterCollections.ConverterQueryMap, ConverterCollections.ConverterSortedMap
Enclosing class:
ConverterCollections

public static class ConverterCollections.ConverterMap
extends Base
implements java.util.Map, java.io.Serializable

A Converter Map views an underlying Map through a set of key and value Converters.


Nested Class Summary

 

Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry

 

Field Summary
protected  Converter m_convKeyDown
          The Converter used to pass keys down to the Map.
protected  Converter m_convKeyUp
          The Converter used to view keys stored in the Map.
protected  Converter m_convValDown
          The Converter used to pass keys down to the Map.
protected  Converter m_convValUp
          The Converter used to view values stored in the Map.
protected  java.util.Map m_map
          The underlying Map.
protected  java.util.Set m_set
          The Entry Set.

 

Constructor Summary
ConverterCollections.ConverterMap(java.util.Map map, Converter convKeyUp, Converter convKeyDown, Converter convValUp, Converter convValDown)
          Constructor.

 

Method Summary
 void clear()
          Removes all mappings from this map.
 boolean containsKey(java.lang.Object key)
          Returns true if this map contains a mapping for the specified key.
 boolean containsValue(java.lang.Object value)
          Returns true if this map maps one or more keys to the specified value.
 java.util.Set entrySet()
          Returns a set view of the mappings contained in this map.
 boolean equals(java.lang.Object o)
          Compares the specified object with this map for equality.
 java.lang.Object get(java.lang.Object key)
          Returns the value to which this map maps the specified key.
 Converter getConverterKeyDown()
          Return the Converter used to pass keys down to the underlying Map.
 Converter getConverterKeyUp()
          Return the Converter used to view the underlying Map's keys through.
 Converter getConverterValueDown()
          Return the Converter used to pass values down to the underlying Map.
 Converter getConverterValueUp()
          Return the Converter used to view the underlying Map's values through.
 java.util.Map getMap()
          Return the underlying Map.
 int hashCode()
          Returns the hash code value for this map.
protected  java.util.Collection instantiateCollection(java.util.Collection col, Converter convUp, Converter convDown)
          Create a Converter Collection.
protected  java.util.Set instantiateEntrySet(java.util.Set set, Converter convKeyUp, Converter convKeyDown, Converter convValUp, Converter convValDown)
          Create a Converter Entry Set.
protected  java.util.Map instantiateMap(java.util.Map map, Converter convKeyUp, Converter convKeyDown, Converter convValUp, Converter convValDown)
          Create a Converter Map.
protected  java.util.Set instantiateSet(java.util.Set set, Converter convUp, Converter convDown)
          Create a Converter Set.
 boolean isEmpty()
          Returns true if this map contains no key-value mappings.
 java.util.Set keySet()
          Returns a set view of the keys contained in this map.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Associates the specified value with the specified key in this map.
 void putAll(java.util.Map map)
          Copies all of the mappings from the specified map to this map.
 java.lang.Object remove(java.lang.Object key)
          Removes the mapping for this key from this map if present.
 int size()
          Returns the number of key-value mappings in this map.
 java.lang.String toString()
          Return a String description for this Map.
 java.util.Collection values()
          Returns a collection view of the values contained in this map.

 

Field Detail

m_map

protected java.util.Map m_map
The underlying Map.

m_convKeyUp

protected Converter m_convKeyUp
The Converter used to view keys stored in the Map.

m_convKeyDown

protected Converter m_convKeyDown
The Converter used to pass keys down to the Map.

m_convValUp

protected Converter m_convValUp
The Converter used to view values stored in the Map.

m_convValDown

protected Converter m_convValDown
The Converter used to pass keys down to the Map.

m_set

protected transient java.util.Set m_set
The Entry Set.

Constructor Detail

ConverterCollections.ConverterMap

public ConverterCollections.ConverterMap(java.util.Map map,
                                         Converter convKeyUp,
                                         Converter convKeyDown,
                                         Converter convValUp,
                                         Converter convValDown)
Constructor.
Parameters:
map - the underlying Map
convKeyUp - the Converter to view the underlying Map's keys through
convKeyDown - the Converter to use to pass keys down to the underlying Map
convValUp - the Converter to view the underlying Map's values through
convValDown - the Converter to use to pass values down to the underlying Map

Method Detail

size

public int size()
Returns the number of key-value mappings in this map.
Specified by:
size in interface java.util.Map
Returns:
the number of key-value mappings in this map

isEmpty

public boolean isEmpty()
Returns true if this map contains no key-value mappings.
Specified by:
isEmpty in interface java.util.Map
Returns:
true if this map contains no key-value mappings

containsKey

public boolean containsKey(java.lang.Object key)
Returns true if this map contains a mapping for the specified key.
Specified by:
containsKey in interface java.util.Map
Parameters:
key - key whose presence in this map is to be tested
Returns:
true if this map contains a mapping for the specified key

containsValue

public boolean containsValue(java.lang.Object value)
Returns true if this map maps one or more keys to the specified value.
Specified by:
containsValue in interface java.util.Map
Parameters:
value - value whose presence in this map is to be tested
Returns:
true if this map maps one or more keys to the specified value.

get

public java.lang.Object get(java.lang.Object key)
Returns the value to which this map maps the specified key. Returns null if the map contains no mapping for this key.
Specified by:
get in interface java.util.Map
Parameters:
key - key whose associated value is to be returned
Returns:
the value to which this map maps the specified key, or null if the map contains no mapping for this key.
See Also:
Map.containsKey(Object)

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Associates the specified value with the specified key in this map.
Specified by:
put in interface java.util.Map
Parameters:
key - key with which the specified value is to be associated
value - value to be associated with the specified key
Returns:
previous value associated with specified key, or null if there was no mapping for key
Throws:
java.lang.ClassCastException - if the class of the specified key or value prevents it from being stored in this map.

remove

public java.lang.Object remove(java.lang.Object key)
Removes the mapping for this key from this map if present.
Specified by:
remove in interface java.util.Map
Parameters:
key - key whose mapping is to be removed from the map
Returns:
previous value associated with specified key, or null if there was no mapping for key

putAll

public void putAll(java.util.Map map)
Copies all of the mappings from the specified map to this map.
Specified by:
putAll in interface java.util.Map
Parameters:
map - Mappings to be stored in this map
Throws:
java.lang.ClassCastException - if the class of a key or value in the specified map prevents it from being stored in this map

clear

public void clear()
Removes all mappings from this map.
Specified by:
clear in interface java.util.Map

keySet

public java.util.Set keySet()
Returns a set view of the keys contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa.
Specified by:
keySet in interface java.util.Map
Returns:
a set view of the keys contained in this map

values

public java.util.Collection values()
Returns a collection view of the values contained in this map. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa.
Specified by:
values in interface java.util.Map
Returns:
a collection view of the values contained in this map

entrySet

public java.util.Set entrySet()
Returns a set view of the mappings contained in this map. Each element in the returned set is a Map.Entry. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa.
Specified by:
entrySet in interface java.util.Map
Returns:
a set view of the mappings contained in this map

toString

public java.lang.String toString()
Return a String description for this Map.
Returns:
a String description of the Map

equals

public boolean equals(java.lang.Object o)
Compares the specified object with this map for equality. Returns true if the given object is also a map and the two Maps represent the same mappings. More formally, two maps t1 and t2 represent the same mappings if t1.entrySet().equals(t2.entrySet()). This ensures that the equals method works properly across different implementations of the Map interface.
Specified by:
equals in interface java.util.Map
Parameters:
o - object to be compared for equality with this map.
Returns:
true if the specified object is equal to this map.

hashCode

public int hashCode()
Returns the hash code value for this map. The hash code of a map is defined to be the sum of the hashCodes of each entry in the map's entrySet view. This ensures that t1.equals(t2) implies that t1.hashCode()==t2.hashCode() for any two maps t1 and t2, as required by the general contract of Object.hashCode.
Specified by:
hashCode in interface java.util.Map
Returns:
the hash code value for this map.
See Also:
Map.Entry.hashCode(), Object.hashCode(), Object.equals(Object), Map.equals(Object)

instantiateCollection

protected java.util.Collection instantiateCollection(java.util.Collection col,
                                                     Converter convUp,
                                                     Converter convDown)
Create a Converter Collection.
Parameters:
col - the underlying Collection
convUp - the Converter to view the underlying Collection through
convDown - the Converter to pass items down to the underlying Collection through
Returns:
a Converter Collection

instantiateSet

protected java.util.Set instantiateSet(java.util.Set set,
                                       Converter convUp,
                                       Converter convDown)
Create a Converter Set.
Parameters:
set - the underlying Set
convUp - the Converter to view the underlying Set through
convDown - the Converter to pass items down to the underlying Set through
Returns:
a Converter Set

instantiateMap

protected java.util.Map instantiateMap(java.util.Map map,
                                       Converter convKeyUp,
                                       Converter convKeyDown,
                                       Converter convValUp,
                                       Converter convValDown)
Create a Converter Map.
Parameters:
map - the underlying Map
convKeyUp - the Converter to view the underlying Map's keys through
convKeyDown - the Converter to use to pass keys down to the underlying Map
convValUp - the Converter to view the underlying Map's values through
convValDown - the Converter to use to pass values down to the underlying Map
Returns:
a Converter Map

instantiateEntrySet

protected java.util.Set instantiateEntrySet(java.util.Set set,
                                            Converter convKeyUp,
                                            Converter convKeyDown,
                                            Converter convValUp,
                                            Converter convValDown)
Create a Converter Entry Set.
Parameters:
set - the underlying Map Entry Set
convKeyUp - the Converter to view the underlying Map's Entry Set's keys through
convKeyDown - the Converter to use to pass keys down to the underlying Map's Entry Set
convValUp - the Converter to view the underlying Map's Entry Set's values through
convValDown - the Converter to use to pass values down to the underlying Map's Entry Set
Returns:
a Converter Entry Set

getMap

public java.util.Map getMap()
Return the underlying Map.
Returns:
the underlying Map

getConverterKeyUp

public Converter getConverterKeyUp()
Return the Converter used to view the underlying Map's keys through.
Returns:
the Converter from the underlying Map's keys

getConverterKeyDown

public Converter getConverterKeyDown()
Return the Converter used to pass keys down to the underlying Map.
Returns:
the Converter to the underlying Map's keys

getConverterValueUp

public Converter getConverterValueUp()
Return the Converter used to view the underlying Map's values through.
Returns:
the Converter from the underlying Map's values

getConverterValueDown

public Converter getConverterValueDown()
Return the Converter used to pass values down to the underlying Map.
Returns:
the Converter to the underlying Map's values

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.