Package com.jalios.jcms
Class AbstractIndexManager
java.lang.Object
com.jalios.jcms.AbstractIndexManager
- Direct Known Subclasses:
AccessControlListIndexManager,CategoryIndexManager,DataIndexManager,GroupIndexManager,PublicationIndexManager
This abstract class provides generic methods to manage data indices.
- Since:
- jcms-6.0.0
- Author:
- Olivier Dedieu
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAbstractIndexManager.DataIndex<D extends Data,C> Collection to store previoulsy computed information associated to Data and DBDatastatic classAbstractIndexManager.DataIndexMap<D extends Data,K, V> Pseudo map to store previoulsy computed information associated to Data and DBDatastatic classAbstractIndexManager.DataIndexSet<D extends Data,E> Pseudo Set to store previoulsy computed information associated to Data and DBData -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <K extends Data,T>
booleanaddIndexWithSet(Map<K, Set<T>> index, K key, Collection<T> values) Associates each item of the given collection of value to the given key in the given index.protected <K extends Data,T>
booleanaddIndexWithSet(Map<K, Set<T>> index, K key, T value) Associates the given value to the given key in the given index.protected <K extends Data,V>
voidclearIndex(Map<K, V> index, K key) Remove the map at the given key in the given index.getIndexWithMap(Map<K, Map<X, Y>> index, K key) Returns the map associated to the given key in the given index.protected <K extends Data,X, Y>
YgetIndexWithMap(Map<K, Map<X, Y>> index, K key, X name) Returns the value associated to the given name for the given key in the given index.getIndexWithSet(Map<K, Set<T>> index, K key) Returns the set associated to the given key in the given index.protected <T extends Data>
TgetOriginalData(T data) Retrieve the orignal Data from the given one (typically if the given data is a clone of an original data)protected <K extends Data,T>
booleanisUndefinedIndexWithSet(Map<K, Set<T>> index, K key) Returns true is key is null or if no index (even empty) is stored in the given index.protected <K extends Data,X, Y>
voidputIndexWithMap(Map<K, Map<X, Y>> index, K key, X name, Y value) Associates the given value to the given name at the given key in the given index.protected <K extends Data,X, Y>
YremoveIndexWithMap(Map<K, Map<X, Y>> index, K key, X name) Remove the given name at the given key in the given index.protected <K extends Data,T>
booleanremoveIndexWithSet(Map<K, Set<T>> index, K key, Collection<T> values) Removes the given values for the given key in the given index.protected <K extends Data,T>
booleanremoveIndexWithSet(Map<K, Set<T>> index, K key, T value) Removes the given value for the given key in the given index.protected <K extends Data,T>
voidsetIndexWithSet(Map<K, Set<T>> index, K key, Set<T> set) Associates the given set to the given key in the given index.
-
Field Details
-
channel
-
-
Constructor Details
-
AbstractIndexManager
public AbstractIndexManager()
-
-
Method Details
-
getOriginalData
Retrieve the orignal Data from the given one (typically if the given data is a clone of an original data)- Parameters:
data- the data (may be a clone of the original)- Returns:
- the original data.
- Since:
- jcms-6.0.0
-
getIndexWithSet
Returns the set associated to the given key in the given index.- Parameters:
index- the indexkey- the key- Returns:
- the set associated to the given key in the given index.
- Since:
- jcms-6.0.0
-
isUndefinedIndexWithSet
Returns true is key is null or if no index (even empty) is stored in the given index.- Parameters:
index- the indexkey- the key- Returns:
- true if no index is associated to this key (or key is null).
- Since:
- jcms-6.1.0
-
setIndexWithSet
Associates the given set to the given key in the given index.- Parameters:
index- the indexkey- the keyset- the set- Since:
- jcms-6.0.0
-
addIndexWithSet
Associates the given value to the given key in the given index.- Parameters:
index- the indexkey- the keyvalue- the value- Returns:
- true if this set did not already contain the specified value.
- Since:
- jcms-6.0.0
-
addIndexWithSet
protected <K extends Data,T> boolean addIndexWithSet(Map<K, Set<T>> index, K key, Collection<T> values) Associates each item of the given collection of value to the given key in the given index.- Parameters:
index- the indexkey- the keyvalues- the values- Returns:
trueif this set changed as a result of the call- Since:
- jcms-9.0.5 JCMS-5821
-
removeIndexWithSet
Removes the given value for the given key in the given index.- Parameters:
index- the indexkey- the keyvalue- the value- Returns:
- true if this set did not already contain the specified value.
- Since:
- jcms-6.0.0
-
removeIndexWithSet
protected <K extends Data,T> boolean removeIndexWithSet(Map<K, Set<T>> index, K key, Collection<T> values) Removes the given values for the given key in the given index.- Parameters:
index- the indexkey- the keyvalues- the values to remove- Returns:
trueif this set changed as a result of the call- Since:
- jcms-9.0.5 JCMS-5821
-
getIndexWithMap
Returns the map associated to the given key in the given index.- Parameters:
index- the indexkey- the key- Returns:
- the map associated to the given key in the given index.
- Since:
- jcms-6.0.0
-
getIndexWithMap
Returns the value associated to the given name for the given key in the given index.- Parameters:
index- the indexkey- the keyname- the name- Returns:
- the value associated to the given name for the given key in the given index.
- Since:
- jcms-6.0.0
-
putIndexWithMap
protected <K extends Data,X, void putIndexWithMapY> (Map<K, Map<X, Y>> index, K key, X name, Y value) Associates the given value to the given name at the given key in the given index.- Parameters:
index- the indexkey- the keyname- the namevalue- the value- Since:
- jcms-6.0.0
-
removeIndexWithMap
Remove the given name at the given key in the given index.- Parameters:
index- the indexkey- the keyname- the name- Returns:
- the removed value
- Since:
- jcms-6.0.0
-
clearIndex
Remove the map at the given key in the given index.- Parameters:
index- the indexkey- the key- Since:
- jcms-6.0.0
-