com.jalios.jcms
Class AbstractIndexManager

java.lang.Object
  extended by com.jalios.jcms.AbstractIndexManager
Direct Known Subclasses:
AccessControlListIndexManager, CategoryIndexManager, DataIndexManager, GroupIndexManager, MemberIndexManager, PublicationIndexManager

public abstract class AbstractIndexManager
extends Object

This abstract class provides generic methods to manage data indices.

Since:
jcms-6.0.0
Author:
Olivier Dedieu

Field Summary
protected  Channel channel
           
 
Constructor Summary
AbstractIndexManager()
           
 
Method Summary
protected
<K extends Data,T>
boolean
addIndexWithSet(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>
void
clearIndex(Map<K,V> index, K key)
          Remove the map at the given key in the given index.
protected
<K extends Data,X,Y>
Map<X,Y>
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>
Y
getIndexWithMap(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.
protected
<K extends Data,T>
Set<T>
getIndexWithSet(Map<K,Set<T>> index, K key)
          Returns the set associated to the given key in the given index.
protected
<K extends Data,T>
boolean
isUndefinedIndexWithSet(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>
void
putIndexWithMap(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>
Y
removeIndexWithMap(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>
boolean
removeIndexWithSet(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>
void
setIndexWithSet(Map<K,Set<T>> index, K key, Set<T> set)
          Associates the given set to the given key in the given index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

channel

protected Channel channel
Constructor Detail

AbstractIndexManager

public AbstractIndexManager()
Method Detail

getIndexWithSet

protected <K extends Data,T> Set<T> getIndexWithSet(Map<K,Set<T>> index,
                                                    K key)
Returns the set associated to the given key in the given index.

Parameters:
index - the index
key - the key
Returns:
the set associated to the given key in the given index.
Since:
jcms-6.0.0

isUndefinedIndexWithSet

protected <K extends Data,T> boolean isUndefinedIndexWithSet(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.

Parameters:
index - the index
key - the key
Returns:
true if no index is associated to this key (or key is null).
Since:
jcms-6.1.0

setIndexWithSet

protected <K extends Data,T> void setIndexWithSet(Map<K,Set<T>> index,
                                                  K key,
                                                  Set<T> set)
Associates the given set to the given key in the given index.

Parameters:
index - the index
key - the key
set - the set
Since:
jcms-6.0.0

addIndexWithSet

protected <K extends Data,T> boolean addIndexWithSet(Map<K,Set<T>> index,
                                                     K key,
                                                     T value)
Associates the given value to the given key in the given index.

Parameters:
index - the index
key - the key
value - 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,
                                                        T value)
Removes the given value for the given key in the given index.

Parameters:
index - the index
key - the key
value - the value
Returns:
true if this set did not already contain the specified value.
Since:
jcms-6.0.0

getIndexWithMap

protected <K extends Data,X,Y> Map<X,Y> getIndexWithMap(Map<K,Map<X,Y>> index,
                                                        K key)
Returns the map associated to the given key in the given index.

Parameters:
index - the index
key - the key
Returns:
the map associated to the given key in the given index.
Since:
jcms-6.0.0

getIndexWithMap

protected <K extends Data,X,Y> Y getIndexWithMap(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.

Parameters:
index - the index
key - the key
name - 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,Y> void putIndexWithMap(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 index
key - the key
name - the name
value - the value
Since:
jcms-6.0.0

removeIndexWithMap

protected <K extends Data,X,Y> Y removeIndexWithMap(Map<K,Map<X,Y>> index,
                                                    K key,
                                                    X name)
Remove the given name at the given key in the given index.

Parameters:
index - the index
key - the key
name - the name
Since:
jcms-6.0.0

clearIndex

protected <K extends Data,V> void clearIndex(Map<K,V> index,
                                             K key)
Remove the map at the given key in the given index.

Parameters:
index - the index
key - the key
Since:
jcms-6.0.0


Copyright © 2001-2010 Jalios SA. All Rights Reserved.