Package com.jalios.jcms
Class AbstractIndexManager.DataIndexMap<D extends Data,K,V>
- java.lang.Object
-
- com.jalios.jcms.AbstractIndexManager.DataIndex<D,java.util.Map<K,V>>
-
- com.jalios.jcms.AbstractIndexManager.DataIndexMap<D,K,V>
-
- Type Parameters:
D
- the data type for which index is being createdK
- the type of key stored in the indexed mapV
- 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
-
-
Field Summary
-
Fields inherited from class com.jalios.jcms.AbstractIndexManager.DataIndex
dataMap, dbDataMap
-
-
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)
Returnstrue
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 com.jalios.jcms.AbstractIndexManager.DataIndex
clear, getOriginalData, putIndexCollection, removeIndexCollection
-
-
-
-
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 retrievedkey
- 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 modifiedkey
- key with which the specified value is to be associated. Important : if a DBData is specified it will be ignored and won't be addedvalue
- 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
, ornull
if there was no mapping forkey
.
-
containsKey
public boolean containsKey(D data)
Returnstrue
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 modifiedkey
- key with which the specified value is to be removed- Returns:
- the previous value associated with
key
, ornull
if there was no mapping forkey
.
-
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
-
-