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 MapCacheStore

    java.lang.Object
      com.tangosol.util.Base
          com.tangosol.net.cache.AbstractCacheLoader
              com.tangosol.net.cache.AbstractCacheStore
                  com.tangosol.net.cache.MapCacheStore

All Implemented Interfaces:
  CacheLoader, CacheStore, IterableCacheLoader

    public class MapCacheStore

extends AbstractCacheStore
implements CacheStore, IterableCacheLoader

A CacheStore that sits directly on top of a Map.

Since:
  Coherence 2.5
Author:
  cp 2004.09.24

Constructor Summary
`MapCacheStore(java.util.Map map)` Create a CacheStore that delegates to a Map.

Method Summary
`void` | `erase(java.lang.Object oKey)` Remove the specified key from the underlying store if present.
`void` | `eraseAll(java.util.Collection colKeys)` Remove the specified keys from the underlying store if present.
`java.util.Map` | `getMap()` Returns the Map that this CacheStore uses for its storage.
`java.util.Iterator` | `keys()` Iterate all keys in the underlying store.
`java.lang.Object` | `load(java.lang.Object oKey)` Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store.
`protected void` | `setMap(java.util.Map map)` Configures the Map that this CacheStore uses for its storage.
`void` | `store(java.lang.Object oKey, java.lang.Object oValue)` Store the specified value under the specified key in the underlying store.
`void` | `storeAll(java.util.Map mapEntries)` Store the specified values under the specified keys in the underlying store.

Methods inherited from class com.tangosol.net.cache.AbstractCacheLoader
`loadAll`

Methods inherited from interface com.tangosol.net.cache.CacheLoader
`loadAll`

Methods inherited from interface com.tangosol.net.cache.CacheLoader
`loadAll`

Constructor Detail

### MapCacheStore

    public MapCacheStore(java.util.Map map)

  Create a CacheStore that delegates to a Map.

  Parameters:
    `map` - the Map to use as the underlying store for this CacheStore

Method Detail

### load

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

  Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store.

  Specified by:
    `load` in interface `CacheLoader`
  Specified by:
    `load` in class `AbstractCacheLoader`
  Parameters:
    `oKey` - key whose associated value is to be returned
  Returns:
    the value associated with the specified key, or `null` if no value is available for that key

### store

    public void store(java.lang.Object oKey,
                      java.lang.Object oValue)

  Store the specified value under the specified key in the underlying store. This method is intended to support both key/value creation and value update for a specific key.

  Specified by:
    `store` in interface `CacheStore`
  Overrides:
    `store` in class `AbstractCacheStore`
  Parameters:
    `oKey` - key to store the value under
    `oValue` - value to be stored

### storeAll

    public void storeAll(java.util.Map mapEntries)

  Store the specified values under the specified keys in the underlying store. This method is intended to support both key/value creation and value update for the specified keys.

  Specified by:
    `storeAll` in interface `CacheStore`
  Overrides:
    `storeAll` in class `AbstractCacheStore`
  Parameters:
    `mapEntries` - a Map of any number of keys and values to store

### erase

    public void erase(java.lang.Object oKey)

  Remove the specified key from the underlying store if present.

  Specified by:
    `erase` in interface `CacheStore`
  Overrides:
    `erase` in class `AbstractCacheStore`
  Parameters:
    `oKey` - key to remove from the store

### eraseAll

    public void eraseAll(java.util.Collection colKeys)

  Remove the specified keys from the underlying store if present.

  Specified by:
    `eraseAll` in interface `CacheStore`
  Overrides:
    `eraseAll` in class `AbstractCacheStore`
  Parameters:
    `colKeys` - keys whose mappings are being removed from the cache

### keys

    public java.util.Iterator keys()

  Iterate all keys in the underlying store.

  Specified by:
    `keys` in interface `IterableCacheLoader`
  Returns:
    a read-only iterator of the keys in the underlying store

### getMap

    public java.util.Map getMap()

  Returns the Map that this CacheStore uses for its storage.

  Returns:
    the Map that this CacheStore uses

### setMap

    protected void setMap(java.util.Map map)

  Configures the Map that this CacheStore uses for its storage.

  Parameters:
    `map` - the Map that this CacheStore will use

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.