|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.topicmapslab.majortom.cache.ConstructCache
public class ConstructCache
Nested Class Summary | |
---|---|
(package private) class |
ConstructCache.CacheKey
|
(package private) static class |
ConstructCache.Key
|
Field Summary | |
---|---|
private AssociationCache |
associationCache
|
private java.util.Map<ConstructCache.CacheKey,java.util.Set<de.topicmapslab.majortom.model.core.IAssociation>> |
associations
|
private CharacteristicsCache |
characteristicsCache
|
private IdentityCache |
identityCache
|
private java.util.Map<ConstructCache.CacheKey,java.util.Set<de.topicmapslab.majortom.model.core.IName>> |
names
|
private java.util.Map<ConstructCache.CacheKey,java.util.Set<de.topicmapslab.majortom.model.core.IOccurrence>> |
occurrences
|
private ReificationCache |
reificationCache
|
private java.util.Map<java.lang.Object,java.util.Set<ConstructCache.CacheKey>> |
relevantCacheKeys
|
private RevisionCache |
revisionCache
|
private java.util.Map<ConstructCache.CacheKey,java.util.Set<de.topicmapslab.majortom.model.core.IAssociationRole>> |
roles
|
private ScopeCache |
scopeCache
|
private java.util.Map<ConstructCache.CacheKey,java.util.Set<de.topicmapslab.majortom.model.core.ITopic>> |
topics
|
private TopicTypeCache |
topicTypeCache
|
private TypedCache |
typedCache
|
private java.util.Map<ConstructCache.CacheKey,java.util.Set<de.topicmapslab.majortom.model.core.IVariant>> |
variants
|
Constructor Summary | |
---|---|
ConstructCache()
|
Method Summary | ||
---|---|---|
void |
cacheAssociation(de.topicmapslab.majortom.model.core.IConstruct context,
de.topicmapslab.majortom.model.core.ITopic type,
de.topicmapslab.majortom.model.core.IScope scope,
java.util.Set<de.topicmapslab.majortom.model.core.IAssociation> set)
Cache the associations of the given parent, the given type and the given scope in the internal store |
|
void |
cacheNames(de.topicmapslab.majortom.model.core.ITopic parent,
de.topicmapslab.majortom.model.core.ITopic type,
de.topicmapslab.majortom.model.core.IScope scope,
java.util.Set<de.topicmapslab.majortom.model.core.IName> set)
Cache the names of the given parent, the given type and the given scope in the internal store |
|
void |
cacheOccurrences(de.topicmapslab.majortom.model.core.ITopic parent,
de.topicmapslab.majortom.model.core.ITopic type,
de.topicmapslab.majortom.model.core.IScope scope,
java.util.Set<de.topicmapslab.majortom.model.core.IOccurrence> set)
Cache the occurrences of the given parent, the given type and the given scope in the internal store |
|
void |
cacheRoles(de.topicmapslab.majortom.model.core.IConstruct context,
de.topicmapslab.majortom.model.core.ITopic type,
java.util.Set<de.topicmapslab.majortom.model.core.IAssociationRole> set)
Cache the roles of the given parent, the given type in the internal store |
|
void |
cacheTopics(de.topicmapslab.majortom.model.core.ITopic type,
java.util.Set<de.topicmapslab.majortom.model.core.ITopic> set)
Cache the topics of the given type to the internal topic map store |
|
void |
cacheVariants(de.topicmapslab.majortom.model.core.IName parent,
de.topicmapslab.majortom.model.core.IScope scope,
java.util.Set<de.topicmapslab.majortom.model.core.IVariant> set)
Cache the variants of the given parent and the given scope in the internal store |
|
void |
clear()
closing the cache instance |
|
private ConstructCache.CacheKey |
generateCacheKey(de.topicmapslab.majortom.model.core.IConstruct context,
de.topicmapslab.majortom.model.core.ITopic type,
de.topicmapslab.majortom.model.core.IScope scope)
Generates a cache key for the given properties |
|
java.util.Set<de.topicmapslab.majortom.model.core.IAssociation> |
getAssociation(de.topicmapslab.majortom.model.core.IConstruct context,
de.topicmapslab.majortom.model.core.ITopic type,
de.topicmapslab.majortom.model.core.IScope scope)
Returns the internal stored associations of the given parent, the given type and the given scope |
|
AssociationCache |
getAssociationCache()
Returns the internal cache reference handling the role-player mappings |
|
CharacteristicsCache |
getCharacteristicsCache()
Returns the internal reference of the sub cache handling datatypes and values |
|
private
|
getConstructs(de.topicmapslab.majortom.model.core.IConstruct parent,
de.topicmapslab.majortom.model.core.ITopic type,
de.topicmapslab.majortom.model.core.IScope scope,
java.util.Map<ConstructCache.CacheKey,java.util.Set<T>> map)
Internal method to access the given map in a secure way. |
|
IdentityCache |
getIdentityCache()
Returns the internal reference of the sub cache handling identities of a construct |
|
java.util.Set<de.topicmapslab.majortom.model.core.IName> |
getNames(de.topicmapslab.majortom.model.core.ITopic parent,
de.topicmapslab.majortom.model.core.ITopic type,
de.topicmapslab.majortom.model.core.IScope scope)
Returns the internal stored names of the given parent, the given type and the given scope |
|
java.util.Set<de.topicmapslab.majortom.model.core.IOccurrence> |
getOccurrences(de.topicmapslab.majortom.model.core.ITopic parent,
de.topicmapslab.majortom.model.core.ITopic type,
de.topicmapslab.majortom.model.core.IScope scope)
Returns the internal stored occurrences of the given parent, the given type and the given scope |
|
ReificationCache |
getReificationCache()
Returns the internal reference of the cache handling the reification between a topic and a reified construct |
|
private java.util.Set<ConstructCache.CacheKey> |
getRelevantCacheKeys(java.lang.Object obj)
Returns all relevant cache keys for the given filter |
|
RevisionCache |
getRevisionCache()
Returns the internal cache reference handling the history |
|
java.util.Set<de.topicmapslab.majortom.model.core.IAssociationRole> |
getRoles(de.topicmapslab.majortom.model.core.IConstruct context,
de.topicmapslab.majortom.model.core.ITopic type)
Returns the internal stored roles of the given parent, the given type |
|
ScopeCache |
getScopeCache()
Returns the internal reference of the cache handling the scopes of a construct |
|
java.util.Set<de.topicmapslab.majortom.model.core.ITopic> |
getTopics(de.topicmapslab.majortom.model.core.ITopic type)
Returns the internal stored topics the given type |
|
TopicTypeCache |
getTopicTypeCache()
Returns the internal reference of the cache handling the topic-type hierarchy |
|
TypedCache |
getTypedCache()
Returns the internal reference of the cache handling the types of a construct |
|
java.util.Set<de.topicmapslab.majortom.model.core.IVariant> |
getVariants(de.topicmapslab.majortom.model.core.IName parent,
de.topicmapslab.majortom.model.core.IScope scope)
Returns the internal stored variants of the given parent and the given scope |
|
void |
topicMapChanged(java.lang.String id,
de.topicmapslab.majortom.model.event.TopicMapEventType event,
org.tmapi.core.Construct notifier,
java.lang.Object newValue,
java.lang.Object oldValue)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private CharacteristicsCache characteristicsCache
private IdentityCache identityCache
private ReificationCache reificationCache
private ScopeCache scopeCache
private TypedCache typedCache
private TopicTypeCache topicTypeCache
private AssociationCache associationCache
private RevisionCache revisionCache
private java.util.Map<ConstructCache.CacheKey,java.util.Set<de.topicmapslab.majortom.model.core.IName>> names
private java.util.Map<ConstructCache.CacheKey,java.util.Set<de.topicmapslab.majortom.model.core.IOccurrence>> occurrences
private java.util.Map<ConstructCache.CacheKey,java.util.Set<de.topicmapslab.majortom.model.core.IAssociation>> associations
private java.util.Map<ConstructCache.CacheKey,java.util.Set<de.topicmapslab.majortom.model.core.IAssociationRole>> roles
private java.util.Map<ConstructCache.CacheKey,java.util.Set<de.topicmapslab.majortom.model.core.IVariant>> variants
private java.util.Map<ConstructCache.CacheKey,java.util.Set<de.topicmapslab.majortom.model.core.ITopic>> topics
private java.util.Map<java.lang.Object,java.util.Set<ConstructCache.CacheKey>> relevantCacheKeys
Constructor Detail |
---|
public ConstructCache()
Method Detail |
---|
private ConstructCache.CacheKey generateCacheKey(de.topicmapslab.majortom.model.core.IConstruct context, de.topicmapslab.majortom.model.core.ITopic type, de.topicmapslab.majortom.model.core.IScope scope)
context
- the context or parent of stored valuestype
- the type of stored valuesscope
- the scope of stored values
private java.util.Set<ConstructCache.CacheKey> getRelevantCacheKeys(java.lang.Object obj)
obj
- the filter
private <T extends de.topicmapslab.majortom.model.core.IConstruct> java.util.Set<T> getConstructs(de.topicmapslab.majortom.model.core.IConstruct parent, de.topicmapslab.majortom.model.core.ITopic type, de.topicmapslab.majortom.model.core.IScope scope, java.util.Map<ConstructCache.CacheKey,java.util.Set<T>> map)
T
- the generic type of requested constructsparent
- the parent or null
type
- the type or null
scope
- the scope or null
map
- the map to extract the constructs
null
if the given map is null
or does not contain the given keypublic java.util.Set<de.topicmapslab.majortom.model.core.IName> getNames(de.topicmapslab.majortom.model.core.ITopic parent, de.topicmapslab.majortom.model.core.ITopic type, de.topicmapslab.majortom.model.core.IScope scope)
parent
- the parent or null
type
- the type or null
scope
- the scope or null
public java.util.Set<de.topicmapslab.majortom.model.core.IOccurrence> getOccurrences(de.topicmapslab.majortom.model.core.ITopic parent, de.topicmapslab.majortom.model.core.ITopic type, de.topicmapslab.majortom.model.core.IScope scope)
parent
- the parent or null
type
- the type or null
scope
- the scope or null
public java.util.Set<de.topicmapslab.majortom.model.core.IVariant> getVariants(de.topicmapslab.majortom.model.core.IName parent, de.topicmapslab.majortom.model.core.IScope scope)
parent
- the parent or null
scope
- the scope or null
public java.util.Set<de.topicmapslab.majortom.model.core.IAssociation> getAssociation(de.topicmapslab.majortom.model.core.IConstruct context, de.topicmapslab.majortom.model.core.ITopic type, de.topicmapslab.majortom.model.core.IScope scope)
context
- the topic map or the playing topic or null
type
- the type or null
scope
- the scope or null
public java.util.Set<de.topicmapslab.majortom.model.core.IAssociationRole> getRoles(de.topicmapslab.majortom.model.core.IConstruct context, de.topicmapslab.majortom.model.core.ITopic type)
context
- the association or the playing topic or null
type
- the type or null
public java.util.Set<de.topicmapslab.majortom.model.core.ITopic> getTopics(de.topicmapslab.majortom.model.core.ITopic type)
type
- the type or null
public void cacheNames(de.topicmapslab.majortom.model.core.ITopic parent, de.topicmapslab.majortom.model.core.ITopic type, de.topicmapslab.majortom.model.core.IScope scope, java.util.Set<de.topicmapslab.majortom.model.core.IName> set)
parent
- the parent or null
type
- the type or null
scope
- the scope or null
set
- the values to cachepublic void cacheOccurrences(de.topicmapslab.majortom.model.core.ITopic parent, de.topicmapslab.majortom.model.core.ITopic type, de.topicmapslab.majortom.model.core.IScope scope, java.util.Set<de.topicmapslab.majortom.model.core.IOccurrence> set)
parent
- the parent or null
type
- the type or null
scope
- the scope or null
set
- the values to cachepublic void cacheVariants(de.topicmapslab.majortom.model.core.IName parent, de.topicmapslab.majortom.model.core.IScope scope, java.util.Set<de.topicmapslab.majortom.model.core.IVariant> set)
parent
- the parent or null
scope
- the scope or null
set
- the values to cachepublic void cacheAssociation(de.topicmapslab.majortom.model.core.IConstruct context, de.topicmapslab.majortom.model.core.ITopic type, de.topicmapslab.majortom.model.core.IScope scope, java.util.Set<de.topicmapslab.majortom.model.core.IAssociation> set)
context
- the topic map or the playing topic or null
type
- the type or null
scope
- the scope or null
set
- the values to cachepublic void cacheRoles(de.topicmapslab.majortom.model.core.IConstruct context, de.topicmapslab.majortom.model.core.ITopic type, java.util.Set<de.topicmapslab.majortom.model.core.IAssociationRole> set)
context
- the association or the playing topic or null
type
- the type or null
set
- the values to cachepublic void cacheTopics(de.topicmapslab.majortom.model.core.ITopic type, java.util.Set<de.topicmapslab.majortom.model.core.ITopic> set)
type
- the type or null
set
- the values to cachepublic CharacteristicsCache getCharacteristicsCache()
public IdentityCache getIdentityCache()
public ReificationCache getReificationCache()
public ScopeCache getScopeCache()
public TypedCache getTypedCache()
public TopicTypeCache getTopicTypeCache()
public AssociationCache getAssociationCache()
public RevisionCache getRevisionCache()
public void clear()
public void topicMapChanged(java.lang.String id, de.topicmapslab.majortom.model.event.TopicMapEventType event, org.tmapi.core.Construct notifier, java.lang.Object newValue, java.lang.Object oldValue)
topicMapChanged
in interface de.topicmapslab.majortom.model.event.ITopicMapListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |