Overview | Package | Class | Tree | Index | Help

Oracle® Coherence Java API Reference
v3.5.3
E15583-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.tangosol.net.cache
Class SimpleSerializationMap

    java.lang.Object
      com.tangosol.util.Base
          com.tangosol.util.AbstractKeyBasedMap
              com.tangosol.net.cache.SimpleSerializationMap

All Implemented Interfaces:
  java.util.Map

    public class SimpleSerializationMap

extends AbstractKeyBasedMap

Map implementation that stores and accesses its contents through an underlying BinaryStore. The Map does not maintain additional state, such as the keys that it contains, which allows it to manage very large sets of data. However, a number of operations that would normally be "free" are potentially very expensive with this implementation. For example, `size()` has to iterate through all the keys provided by the underlying BinaryStore, and `containsKey(java.lang.Object)` has to read the value from the underlying BinaryStore to prove its existence.

Since:
  Coherence 3.1
Author:
  cp 2005.11.23

Nested Class Summary

Nested classes/interfaces inherited from class com.tangosol.util.AbstractKeyBasedMap
`AbstractKeyBasedMap.EntrySet, AbstractKeyBasedMap.KeySet, AbstractKeyBasedMap.ValuesCollection`

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

Constructor Summary
`SimpleSerializationMap(BinaryStore store)` Construct a SimpleSerializationMap on top of a BinaryStore.
`SimpleSerializationMap(BinaryStore store, boolean fBinaryMap)` Construct a SimpleSerializationMap on top of a BinaryStore, optionally storing only Binary keys and values.
`SimpleSerializationMap(BinaryStore store, java.lang.ClassLoader loader)` Construct a SimpleSerializationMap on top of a BinaryStore, using the passed ClassLoader for deserialization.

Method Summary
`void` | `clear()` Clear all key/value mappings.
`boolean` | `containsKey(java.lang.Object oKey)` Returns `true` if this map contains a mapping for the specified key.
`boolean` | `containsValue(java.lang.Object oValue)` Returns `true` if this Map maps one or more keys to the specified value.
`protected java.lang.Object` | `fromBinary(Binary bin)` Translate the passed Binary object into an Object object.
`java.lang.Object` | `get(java.lang.Object oKey)` Returns the value to which this map maps the specified key.
`BinaryStore` | `getBinaryStore()` Returns the BinaryStore that this map uses for its storage.
`CacheStatistics` | `getCacheStatistics()` Returns the CacheStatistics for this cache.
`java.lang.ClassLoader` | `getClassLoader()` Returns the ClassLoader that this map uses for deserialization, if it has one.
`boolean` | `isBinaryMap()` Determine if the keys and values in this map are known to be all Binary.
`boolean` | `isEmpty()` Returns `true` if this map contains no key-value mappings.
`protected java.util.Iterator` | `iterateKeys()` Create an iterator over the keys in this Map.
`java.lang.Object` | `put(java.lang.Object oKey, java.lang.Object oValue)` 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 oKey)` Removes the mapping for this key from this map if present.
`protected boolean` | `removeBlind(java.lang.Object oKey)` Removes the mapping for this key from this map if present.
`protected void` | `setBinaryMap(boolean fBinary)` Configure the Map to be aware that all the keys and values in the map are known to be Binary or not.
`protected void` | `setBinaryStore(BinaryStore store)` Configures the BinaryStore that this map will use for its storage.
`protected void` | `setClassLoader(java.lang.ClassLoader loader)` Configure the ClassLoader that this map will use for deserialization.
`int` | `size()` Returns the number of key-value mappings in this map.
`protected Binary` | `toBinary(java.lang.Object o)` Translate the passed Object object into an Binary object.
`java.lang.String` | `toString()` Returns a string representation of this Map.

Methods inherited from class com.tangosol.util.AbstractKeyBasedMap
`clone, entrySet, equals, getAll, hashCode, instantiateEntrySet, instantiateKeySet, instantiateValues, keySet, values`

Constructor Detail

### SimpleSerializationMap

    public SimpleSerializationMap(BinaryStore store)

  Construct a SimpleSerializationMap on top of a BinaryStore.

  Parameters:
    `store` - the BinaryStore to use to write the serialized objects to

### SimpleSerializationMap

    public SimpleSerializationMap(BinaryStore store,
                                  java.lang.ClassLoader loader)

  Construct a SimpleSerializationMap on top of a BinaryStore, using the passed ClassLoader for deserialization.

  Parameters:
    `store` - the BinaryStore to use to write the serialized objects to
    `loader` - the ClassLoader to use for deserialization

### SimpleSerializationMap

    public SimpleSerializationMap(BinaryStore store,
                                  boolean fBinaryMap)

  Construct a SimpleSerializationMap on top of a BinaryStore, optionally storing only Binary keys and values.

  Parameters:
    `store` - the BinaryStore to use to write the serialized objects to
    `fBinaryMap` - true indicates that this map will only manage binary keys and values

Method Detail

### clear

    public void clear()

  Clear all key/value mappings.

  Specified by:
    `clear` in interface `java.util.Map`
  Overrides:
    `clear` in class `AbstractKeyBasedMap`

### containsKey

    public boolean containsKey(java.lang.Object oKey)

  Returns `true` if this map contains a mapping for the specified key.

  Specified by:
    `containsKey` in interface `java.util.Map`
  Overrides:
    `containsKey` in class `AbstractKeyBasedMap`
  Returns:
    `true` if this map contains a mapping for the specified key, `false` otherwise.

### containsValue

    public boolean containsValue(java.lang.Object oValue)

  Returns `true` if this Map maps one or more keys to the specified value.

  Specified by:
    `containsValue` in interface `java.util.Map`
  Overrides:
    `containsValue` in class `AbstractKeyBasedMap`
  Returns:
    `true` if this Map maps one or more keys to the specified value, `false` otherwise

### get

    public java.lang.Object get(java.lang.Object oKey)

  Returns the value to which this map maps the specified key.

  Specified by:
    `get` in interface `java.util.Map`
  Specified by:
    `get` in class `AbstractKeyBasedMap`
  Parameters:
    `oKey` - the key object
  Returns:
    the value to which this map maps the specified key, or null if the map contains no mapping for this key

### isEmpty

    public boolean isEmpty()

  Returns `true` if this map contains no key-value mappings.

  Specified by:
    `isEmpty` in interface `java.util.Map`
  Overrides:
    `isEmpty` in class `AbstractKeyBasedMap`
  Returns:
    `true` if this map contains no key-value mappings

### put

    public java.lang.Object put(java.lang.Object oKey,
                                java.lang.Object oValue)

  Associates the specified value with the specified key in this map.

  Specified by:
    `put` in interface `java.util.Map`
  Overrides:
    `put` in class `AbstractKeyBasedMap`
  Parameters:
    `oKey` - key with which the specified value is to be associated
    `oValue` - value to be associated with the specified key
  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. The effect of this call is equivalent to that of calling `AbstractKeyBasedMap.put(java.lang.Object, java.lang.Object)` on this map once for each mapping in the passed map. The behavior of this operation is unspecified if the passed map is modified while the operation is in progress.

  Specified by:
    `putAll` in interface `java.util.Map`
  Overrides:
    `putAll` in class `AbstractKeyBasedMap`
  Parameters:
    `map` - the Map containing the key/value pairings to put into this Map

### remove

    public java.lang.Object remove(java.lang.Object oKey)

  Removes the mapping for this key from this map if present. Expensive: updates both the underlying cache and the local cache.

  Specified by:
    `remove` in interface `java.util.Map`
  Overrides:
    `remove` in class `AbstractKeyBasedMap`
  Parameters:
    `oKey` - 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. A `null` return can also indicate that the map previously associated `null` with the specified key, if the implementation supports `null` values.

### size

    public int size()

  Returns the number of key-value mappings in this map.

  Specified by:
    `size` in interface `java.util.Map`
  Overrides:
    `size` in class `AbstractKeyBasedMap`
  Returns:
    the number of key-value mappings in this map

### iterateKeys

    protected java.util.Iterator iterateKeys()

  Create an iterator over the keys in this Map. The Iterator must support remove() if the Map supports removal.

  Specified by:
    `iterateKeys` in class `AbstractKeyBasedMap`
  Returns:
    a new instance of an Iterator over the keys in this Map

### removeBlind

    protected boolean removeBlind(java.lang.Object oKey)

  Removes the mapping for this key from this map if present. This method exists to allow sub-classes to optmiize remove functionalitly for situations in which the original value is not required.

  Overrides:
    `removeBlind` in class `AbstractKeyBasedMap`
  Parameters:
    `oKey` - key whose mapping is to be removed from the map
  Returns:
    true iff the Map changed as the result of this operation

### toString

    public java.lang.String toString()

  Returns a string representation of this Map. The string representation consists of a list of key-value mappings in the order returned by the Map's `entrySet` view's iterator, enclosed in braces (`"{}"`). Adjacent mappings are separated by the characters `", "` (comma and space). Each key-value mapping is rendered as the key followed by an equals sign (`"="`) followed by the associated value. Keys and values are converted to strings as by `String.valueOf(Object)`.

  Overrides:
    `toString` in class `AbstractKeyBasedMap`
  Returns:
    a String representation of this Map

### getBinaryStore

    public BinaryStore getBinaryStore()

  Returns the BinaryStore that this map uses for its storage.

  Note: This implementation assumes that the BinaryStore is only being modified by this Map instance. If you modify the BinaryStore contents, the behavior of this Map is undefined.

  Returns:
    the BinaryStore

### setBinaryStore

    protected void setBinaryStore(BinaryStore store)

  Configures the BinaryStore that this map will use for its storage.

  Parameters:
    `store` - the BinaryStore to use

### getClassLoader

    public java.lang.ClassLoader getClassLoader()

  Returns the ClassLoader that this map uses for deserialization, if it has one.

  Returns:
    the ClassLoader that this map uses for deserialization; may be null

### setClassLoader

    protected void setClassLoader(java.lang.ClassLoader loader)

  Configure the ClassLoader that this map will use for deserialization.

  Parameters:
    `loader` - the ClassLoader that this map should use for deserialization

### isBinaryMap

    public boolean isBinaryMap()

  Determine if the keys and values in this map are known to be all Binary.

  Returns:
    true if all keys and values will be Binary to start with, and thus will not require conversion

### setBinaryMap

    protected void setBinaryMap(boolean fBinary)

  Configure the Map to be aware that all the keys and values in the map are known to be Binary or not.

  Parameters:
    `fBinary` - pass true if all keys and values will be Binary

### getCacheStatistics

    public CacheStatistics getCacheStatistics()

  Returns the CacheStatistics for this cache.

  Returns:
    a CacheStatistics object

### toBinary

    protected Binary toBinary(java.lang.Object o)

  Translate the passed Object object into an Binary object.

  Parameters:
    `o` - the Object to serialize into a Binary object
  Returns:
    the Binary object

### fromBinary

    protected java.lang.Object fromBinary(Binary bin)

  Translate the passed Binary object into an Object object.

  Parameters:
    `bin` - the Binary object to deserialize
  Returns:
    the deserialized object

Overview | Package | Class | Tree | Index | Help

Oracle® Coherence Java API Reference
v3.5.3
E15583-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2010, Oracle. All rights reserved.