Interface JKMap<K,V>

Type Parameters:
K - Specifies the type of the keys inside the map.
V - Specifies the type of values inside the map.
All Known Implementing Classes:
JKGuavaCacheWrapper, JKMapWrapper

public interface JKMap<K,V>
This interface is a generic interface that represents a map.

Implementation of this interface provides methods for managing and accessing items contained within the map.

Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Method Summary

    Modifier and Type
    Method
    Description
    This method returns the current JKMap entries as a Map.
    void
    This method clears all the map entries.
    boolean
    This method checks whether this map contains the specified key or not.
    get(K k)
    This method gets the value to which the specified key is mapped in this map.
    This method returns the keys set of this map.
    void
    put(K k, V v)
    This method associates the specified value with the specified key in this map.
    remove(K key)
    This method removes the entry that is associated with the specified key, and return the value of the removed entry.
  • Method Details

    • put

      void put(K k, V v)
      This method associates the specified value with the specified key in this map.
      Parameters:
      k - Specifies the key with which the specified value is to be associated.
      v - Specifies the value to be associated with the specified key.
    • get

      V get(K k)
      This method gets the value to which the specified key is mapped in this map.
      Parameters:
      k - Specifies the key with which the value is associated with.
      Returns:
      the value that is associated with the specified key.
    • clear

      void clear()
      This method clears all the map entries.
    • keySet

      Set<K> keySet()
      This method returns the keys set of this map.
      Returns:
      a set of the keys in this map.
    • containsKey

      boolean containsKey(K key)
      This method checks whether this map contains the specified key or not.
      Parameters:
      key - Specifies the key to be searched for in this map.
      Returns:
      true, if this map contains the specified key, false, otherwise.
    • remove

      V remove(K key)
      This method removes the entry that is associated with the specified key, and return the value of the removed entry.

      The map will not contain a mapping for the specified key once the call returns.

      Parameters:
      key - Specifies the key which the entry is associated with.
      Returns:
      the associated value in the entry that was removed.
    • asMap

      Map<K,V> asMap()
      This method returns the current JKMap entries as a Map.
      Returns:
      a Map containing all the entries inside the JKMap