Class AbstractIndexManager.DataIndexMap<D extends Data,​K,​V>

  • Type Parameters:
    D - the data type for which index is being created
    K - the type of key stored in the indexed map
    V - the type of value stored in the indexed map
    Enclosing class:
    AbstractIndexManager

    public static class AbstractIndexManager.DataIndexMap<D extends Data,​K,​V>
    extends AbstractIndexManager.DataIndex<D,​java.util.Map<K,​V>>
    Pseudo map to store previoulsy computed information associated to Data and DBData
    Since:
    9.0.3 - JCMS-5258
    • Constructor Summary

      Constructors 
      Constructor Description
      DataIndexMap()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear​(D data)
      Removes all of the mappings from the Map associated to the specified Data.
      boolean containsKey​(D data)
      Returns true if this index contains a mapping for the specified data.
      java.util.Map<K,​V> get​(D data)
      Retrieve the Map associated to the specified data.
      V get​(D data, K key)
      Retrieve the value associated to the specified data and key.
      V put​(D data, K key, V value)
      Add the specified key/value pair to the Map corresponding to the specified data.
      V remove​(D data, K key)
      Removes the mapping for a key from the Map corresponding to the specified data.
      • Methods inherited from class java.lang.Object

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

      • DataIndexMap

        public DataIndexMap()
    • Method Detail

      • get

        public java.util.Map<K,​V> get​(D data)
        Retrieve the Map associated to the specified data.
        Parameters:
        data - the data for which the IndexMap is being retrieved
        Returns:
        an unmodifiable Map, never return null (instead return empty Map)
      • get

        public V get​(D data,
                     K key)
        Retrieve the value associated to the specified data and key.
        Parameters:
        data - the data for which the IndexMap is being retrieved
        key - the key of the map
        Returns:
        the valueor null if it does not exist.
        Since:
        jcms-10.0.1
      • put

        public V put​(D data,
                     K key,
                     V value)
        Add the specified key/value pair to the Map corresponding to the specified data.
        Parameters:
        data - the data for which the IndexMap is being modified
        key - key with which the specified value is to be associated. Important : if a DBData is specified it will be ignored and won't be added
        value - value to be associated with the specified key. Important : if a DBData is specified it will be ignored and won't be added
        Returns:
        the previous value associated with key, or null if there was no mapping for key.
      • containsKey

        public boolean containsKey​(D data)
        Returns true if this index contains a mapping for the specified data.
        Parameters:
        data - the data
        Returns:
        true if this index contains a mapping for the specified data.
        Since:
        jcms-10.0.1
      • remove

        public V remove​(D data,
                        K key)
        Removes the mapping for a key from the Map corresponding to the specified data.
        Parameters:
        data - the data for which the IndexMap is being modified
        key - key with which the specified value is to be removed
        Returns:
        the previous value associated with key, or null if there was no mapping for key.
      • clear

        public void clear​(D data)
        Removes all of the mappings from the Map associated to the specified Data. The map will be empty after this call returns.
        Parameters:
        data - the data for which the IndexMap is being modified