de.topicmapslab.majortom.cache
Class CharacteristicsCache

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

 class CharacteristicsCache
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.ILocator,java.util.Set<de.topicmapslab.majortom.model.core.IDatatypeAware>> dataTyped
          storage map of datatype mapping
private  java.util.Map<de.topicmapslab.majortom.model.core.IDatatypeAware,de.topicmapslab.majortom.model.core.ILocator> dataTypes
          storage map of datatype mapping
private  java.util.Map<de.topicmapslab.majortom.model.core.IConstruct,java.lang.Object> values
          storage map of characteristics-value mapping
 
Constructor Summary
CharacteristicsCache()
           
 
Method Summary
 void cacheDatatype(de.topicmapslab.majortom.model.core.IDatatypeAware datatypeAware, de.topicmapslab.majortom.model.core.ILocator datatype)
          Cache the datatype of the given construct to the internal store.
 void cacheDatatypeAwares(de.topicmapslab.majortom.model.core.ILocator locator, java.util.Set<de.topicmapslab.majortom.model.core.IDatatypeAware> set)
          Cache the given data-typed items with the given data type into internal cache.
 void cacheValue(de.topicmapslab.majortom.model.core.IConstruct construct, java.lang.Object value)
          Cache the value to the given construct into internal cache
 void clear()
          
 de.topicmapslab.majortom.model.core.ILocator getDatatype(de.topicmapslab.majortom.model.core.IDatatypeAware dataTypeAware)
          Returns the data type of the given data-type-aware
 java.util.Set<de.topicmapslab.majortom.model.core.IDatatypeAware> getDatatypeAwares(de.topicmapslab.majortom.model.core.ILocator locator)
          Returns all data-typed items with the given data type.
 java.lang.Object getValue(de.topicmapslab.majortom.model.core.IConstruct obj)
          Returns the value of the given object
 java.lang.String getValueAsString(de.topicmapslab.majortom.model.core.IConstruct obj)
          Returns the value of the given object
 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

dataTypes

private java.util.Map<de.topicmapslab.majortom.model.core.IDatatypeAware,de.topicmapslab.majortom.model.core.ILocator> dataTypes
storage map of datatype mapping


dataTyped

private java.util.Map<de.topicmapslab.majortom.model.core.ILocator,java.util.Set<de.topicmapslab.majortom.model.core.IDatatypeAware>> dataTyped
storage map of datatype mapping


values

private java.util.Map<de.topicmapslab.majortom.model.core.IConstruct,java.lang.Object> values
storage map of characteristics-value mapping

Constructor Detail

CharacteristicsCache

CharacteristicsCache()
Method Detail

clear

public void clear()


getDatatype

public de.topicmapslab.majortom.model.core.ILocator getDatatype(de.topicmapslab.majortom.model.core.IDatatypeAware dataTypeAware)
Returns the data type of the given data-type-aware

Parameters:
dataTypeAware - the data-type-aware
Returns:
the data type

cacheDatatype

public void cacheDatatype(de.topicmapslab.majortom.model.core.IDatatypeAware datatypeAware,
                          de.topicmapslab.majortom.model.core.ILocator datatype)
Cache the datatype of the given construct to the internal store.

Parameters:
datatypeAware - the construct
datatype - the datatype

getValue

public java.lang.Object getValue(de.topicmapslab.majortom.model.core.IConstruct obj)
Returns the value of the given object

Parameters:
obj - the object
Returns:
the value

getValueAsString

public java.lang.String getValueAsString(de.topicmapslab.majortom.model.core.IConstruct obj)
Returns the value of the given object

Parameters:
obj - the object
Returns:
the value

cacheValue

public void cacheValue(de.topicmapslab.majortom.model.core.IConstruct construct,
                       java.lang.Object value)
Cache the value to the given construct into internal cache

Parameters:
construct - the construct
value - the value

getDatatypeAwares

public java.util.Set<de.topicmapslab.majortom.model.core.IDatatypeAware> getDatatypeAwares(de.topicmapslab.majortom.model.core.ILocator locator)
Returns all data-typed items with the given data type.

Parameters:
locator - the data type
Returns:
a set

cacheDatatypeAwares

public void cacheDatatypeAwares(de.topicmapslab.majortom.model.core.ILocator locator,
                                java.util.Set<de.topicmapslab.majortom.model.core.IDatatypeAware> set)
Cache the given data-typed items with the given data type into internal cache.

Parameters:
locator - the data type
set - all data-typed items

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