Class BinaryMapStore

java.lang.Object
com.tangosol.io.nio.BinaryMapStore
All Implemented Interfaces:
Disposable, BinaryStore, BinaryStore.SizeAware, AutoCloseable

public class BinaryMapStore extends Object implements BinaryStore, BinaryStore.SizeAware, Disposable
An implementation of BinaryStore backed by a BinaryMap.
Since:
Coherence 2.4
Author:
cp 2004.03.31
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.tangosol.io.BinaryStore

    BinaryStore.KeySetAware, BinaryStore.SizeAware
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct a BinaryMapStore object, which is an implementation of the BinaryStore interface backed by a BinaryMap.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated.
    use the Disposable interface instead
    void
    Invoked when all resources owned by the implementer can safely be released.
    void
    erase(Binary binKey)
    Remove the specified key from the underlying store if present.
    void
    Remove all data from the underlying store.
    Obtain the underlying BinaryMap.
    Iterate all keys in the underlying store.
    load(Binary binKey)
    Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store.
    int
    Determine the number of keys in the BinaryStore.
    void
    store(Binary binKey, Binary binValue)
    Store the specified value under the specific key in the underlying store.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BinaryMapStore

      public BinaryMapStore(BinaryMap map)
      Construct a BinaryMapStore object, which is an implementation of the BinaryStore interface backed by a BinaryMap.
      Parameters:
      map - the BinaryMap to use for storage for this BinaryStore implementation
  • Method Details

    • getBinaryMap

      public BinaryMap getBinaryMap()
      Obtain the underlying BinaryMap.
      Returns:
      the BinaryMap that this BinaryStore sits on top of
    • load

      public Binary load(Binary binKey)
      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 BinaryStore
      Parameters:
      binKey - 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(Binary binKey, Binary binValue)
      Store the specified value under the specific 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 BinaryStore
      Parameters:
      binKey - key to store the value under
      binValue - value to be stored
    • erase

      public void erase(Binary binKey)
      Remove the specified key from the underlying store if present.
      Specified by:
      erase in interface BinaryStore
      Parameters:
      binKey - key whose mapping is to be removed from the map
    • eraseAll

      public void eraseAll()
      Remove all data from the underlying store.
      Specified by:
      eraseAll in interface BinaryStore
    • keys

      public Iterator keys()
      Iterate all keys in the underlying store.
      Specified by:
      keys in interface BinaryStore
      Returns:
      a read-only iterator of the keys in the underlying store
    • size

      public int size()
      Determine the number of keys in the BinaryStore.
      Specified by:
      size in interface BinaryStore.SizeAware
      Returns:
      the number of keys in the BinaryStore
    • dispose

      public void dispose()
      Invoked when all resources owned by the implementer can safely be released.

      Once disposed of the object should no longer be considered to be usable.

      Note the Disposable interface is compatible with try-with-resources which will automatically invoke this method.

      Specified by:
      dispose in interface Disposable
    • close

      public void close()
      Deprecated.
      use the Disposable interface instead
      Release underlying resources.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Disposable