de.topicmapslab.majortom.cache
Class AssociationCache

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

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

Author:
Sven Krosse

Field Summary
private  java.util.Map<de.topicmapslab.majortom.model.core.IAssociationRole,de.topicmapslab.majortom.model.core.ITopic> players
           
 
Constructor Summary
AssociationCache()
           
 
Method Summary
 void cachePlayer(de.topicmapslab.majortom.model.core.IAssociationRole role, de.topicmapslab.majortom.model.core.ITopic player)
          Cache the player of the given role into internal store
 void clear()
          remove all contents from the internal cache
 de.topicmapslab.majortom.model.core.ITopic getPlayer(de.topicmapslab.majortom.model.core.IAssociationRole role)
          Returns the player of the given role
 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

players

private java.util.Map<de.topicmapslab.majortom.model.core.IAssociationRole,de.topicmapslab.majortom.model.core.ITopic> players
Constructor Detail

AssociationCache

public AssociationCache()
Method Detail

clear

public void clear()
remove all contents from the internal cache


getPlayer

public de.topicmapslab.majortom.model.core.ITopic getPlayer(de.topicmapslab.majortom.model.core.IAssociationRole role)
Returns the player of the given role

Parameters:
role - the role
Returns:
the player or null

cachePlayer

public void cachePlayer(de.topicmapslab.majortom.model.core.IAssociationRole role,
                        de.topicmapslab.majortom.model.core.ITopic player)
Cache the player of the given role into internal store

Parameters:
role - the role
player - the player

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