Class BitSetENTCacheImpl
- java.lang.Object
-
- org.apache.jackrabbit.core.nodetype.BitSetENTCacheImpl
-
- All Implemented Interfaces:
Cloneable
,EffectiveNodeTypeCache
public class BitSetENTCacheImpl extends Object implements EffectiveNodeTypeCache
Implements an effective node type cache that uses a bit set for storing the information about participating node types in a set.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.jackrabbit.core.nodetype.EffectiveNodeTypeCache
EffectiveNodeTypeCache.Key
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
boolean
contains(EffectiveNodeTypeCache.Key key)
Checks if the effective node type for the given key exists.EffectiveNodeTypeCache.Key
findBest(EffectiveNodeTypeCache.Key key)
Searches the best key k for which the givenkey
is a super set, i.e.EffectiveNodeType
get(EffectiveNodeTypeCache.Key key)
Returns the effective node type for the given key ornull
if the desired node type is not cached.EffectiveNodeTypeCache.Key
getKey(Name[] ntNames)
Returns a key for an effective node type that consists of the given node type names.void
invalidate(Name name)
Removes all effective node types that are aggregated with the node type of the given name.void
put(EffectiveNodeType ent)
Puts an effective node type to the cache.void
put(EffectiveNodeTypeCache.Key key, EffectiveNodeType ent)
Puts an effective node type to the cache for the given key.String
toString()
-
-
-
Method Detail
-
getKey
public EffectiveNodeTypeCache.Key getKey(Name[] ntNames)
Returns a key for an effective node type that consists of the given node type names.- Specified by:
getKey
in interfaceEffectiveNodeTypeCache
- Parameters:
ntNames
- the array of node type names for the effective node type- Returns:
- the key to an effective node type.
-
put
public void put(EffectiveNodeType ent)
Puts an effective node type to the cache. The key is internally generated from the set of merged node types.- Specified by:
put
in interfaceEffectiveNodeTypeCache
- Parameters:
ent
- the effective node type to put to the cache
-
put
public void put(EffectiveNodeTypeCache.Key key, EffectiveNodeType ent)
Puts an effective node type to the cache for the given key.- Specified by:
put
in interfaceEffectiveNodeTypeCache
- Parameters:
key
- the key for the effective node typeent
- the effective node type to put to the cache
-
findBest
public EffectiveNodeTypeCache.Key findBest(EffectiveNodeTypeCache.Key key)
Searches the best key k for which the givenkey
is a super set, i.e. for whichEffectiveNodeTypeCache.Key.contains(Key)
} returnstrue
. If an already cached effective node type matches the key it is returned.- Specified by:
findBest
in interfaceEffectiveNodeTypeCache
- Parameters:
key
- the key for which the subkey is to be searched- Returns:
- the best key or
null
if no key could be found.
-
invalidate
public void invalidate(Name name)
Removes all effective node types that are aggregated with the node type of the given name.- Specified by:
invalidate
in interfaceEffectiveNodeTypeCache
- Parameters:
name
- the name of the node type.
-
contains
public boolean contains(EffectiveNodeTypeCache.Key key)
Checks if the effective node type for the given key exists.- Specified by:
contains
in interfaceEffectiveNodeTypeCache
- Parameters:
key
- the key to check- Returns:
true
if the effective node type is cached;false
otherwise.
-
get
public EffectiveNodeType get(EffectiveNodeTypeCache.Key key)
Returns the effective node type for the given key ornull
if the desired node type is not cached.- Specified by:
get
in interfaceEffectiveNodeTypeCache
- Parameters:
key
- the key for the effective node type.- Returns:
- the effective node type or
null
-
clone
public Object clone()
- Specified by:
clone
in interfaceEffectiveNodeTypeCache
- Overrides:
clone
in classObject
-
-