de.topicmapslab.majortom.cache
Class ReificationCache

java.lang.Object
  extended by de.topicmapslab.majortom.cache.ReificationCache
All Implemented Interfaces:
de.topicmapslab.majortom.model.event.ITopicMapListener

 class ReificationCache
extends java.lang.Object
implements de.topicmapslab.majortom.model.event.ITopicMapListener

Inner class handling the caching of reification

Author:
Sven Krosse

Field Summary
private  org.apache.commons.collections.bidimap.TreeBidiMap reification
          internal storage map if reifier-reified relation
 
Constructor Summary
ReificationCache()
           
 
Method Summary
 void cacheReification(de.topicmapslab.majortom.model.core.IReifiable reifiable, de.topicmapslab.majortom.model.core.ITopic reifier)
          Cache the given reification into internal cache
 void clear()
          
 de.topicmapslab.majortom.model.core.IReifiable getReified(de.topicmapslab.majortom.model.core.ITopic reifier)
          Returns the reified item of the given reifier
 de.topicmapslab.majortom.model.core.ITopic getReifier(de.topicmapslab.majortom.model.core.IReifiable reifiable)
          Returns the current stored reifier of the given reified item.
 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

reification

private org.apache.commons.collections.bidimap.TreeBidiMap reification
internal storage map if reifier-reified relation

Constructor Detail

ReificationCache

ReificationCache()
Method Detail

clear

public void clear()


getReifier

public de.topicmapslab.majortom.model.core.ITopic getReifier(de.topicmapslab.majortom.model.core.IReifiable reifiable)
Returns the current stored reifier of the given reified item.

Parameters:
reifiable - the reified item
Returns:
the reifier or null

getReified

public de.topicmapslab.majortom.model.core.IReifiable getReified(de.topicmapslab.majortom.model.core.ITopic reifier)
Returns the reified item of the given reifier

Parameters:
reifier - the reifier
Returns:
the reified item or null

cacheReification

public void cacheReification(de.topicmapslab.majortom.model.core.IReifiable reifiable,
                             de.topicmapslab.majortom.model.core.ITopic reifier)
Cache the given reification into internal cache

Parameters:
reifiable - the reified construct
reifier - the reifier

topicMapChanged

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)

Specified by:
topicMapChanged in interface de.topicmapslab.majortom.model.event.ITopicMapListener