de.topicmapslab.majortom.inmemory.store.internal
Class ReificationStore

java.lang.Object
  extended by de.topicmapslab.majortom.inmemory.store.internal.ReificationStore
All Implemented Interfaces:
IDataStore
Direct Known Subclasses:
VirtualReificationStore

public class ReificationStore
extends java.lang.Object
implements IDataStore

Internal data store of reifier-reified relations.

Author:
Sven Krosse

Field Summary
private  org.apache.commons.collections.bidimap.TreeBidiMap reification
          internal storage map if reifier-reified relation
private  InMemoryTopicMapStore store
          the parent store
 
Constructor Summary
ReificationStore(InMemoryTopicMapStore store)
          constructor
 
Method Summary
 void close()
          Remove all items from the internal store.
protected  org.apache.commons.collections.bidimap.TreeBidiMap getReificationMap()
           
 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.
protected  InMemoryTopicMapStore getStore()
          Return the internal stored store instance.
 void removeReification(de.topicmapslab.majortom.model.core.IReifiable reifiable)
          Remove the reification from the internal store.
 de.topicmapslab.majortom.model.core.IReifiable removeReifier(de.topicmapslab.majortom.model.core.ITopic reifier)
          Remove the reifier from the internal store.
 void replace(de.topicmapslab.majortom.model.core.ITopic topic, de.topicmapslab.majortom.model.core.ITopic replacement, de.topicmapslab.majortom.model.revision.IRevision revision)
          Replace each reference of the given topic by the given replacement.
 de.topicmapslab.majortom.model.core.ITopic setReifier(de.topicmapslab.majortom.model.core.IReifiable reifiable, de.topicmapslab.majortom.model.core.ITopic reifier)
          Create a new relation between the given reifier and the reified construct
 
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


store

private final InMemoryTopicMapStore store
the parent store

Constructor Detail

ReificationStore

public ReificationStore(InMemoryTopicMapStore store)
constructor

Parameters:
store - the parent store
Method Detail

close

public void close()
Remove all items from the internal store.

Specified by:
close in interface IDataStore

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

setReifier

public de.topicmapslab.majortom.model.core.ITopic setReifier(de.topicmapslab.majortom.model.core.IReifiable reifiable,
                                                             de.topicmapslab.majortom.model.core.ITopic reifier)
Create a new relation between the given reifier and the reified construct

Parameters:
reifiable - the reified construct
reifier - the reifier
Returns:
the old reifier or null

removeReification

public void removeReification(de.topicmapslab.majortom.model.core.IReifiable reifiable)
Remove the reification from the internal store.

Parameters:
reifiable - reified item

removeReifier

public de.topicmapslab.majortom.model.core.IReifiable removeReifier(de.topicmapslab.majortom.model.core.ITopic reifier)
Remove the reifier from the internal store.

Parameters:
reifiable - reified item
Returns:
the reified item

replace

public void replace(de.topicmapslab.majortom.model.core.ITopic topic,
                    de.topicmapslab.majortom.model.core.ITopic replacement,
                    de.topicmapslab.majortom.model.revision.IRevision revision)
Replace each reference of the given topic by the given replacement.

Specified by:
replace in interface IDataStore
Parameters:
topic - the topic
replacement - the replacement
revision - the revision

getStore

protected InMemoryTopicMapStore getStore()
Return the internal stored store instance.

Returns:
the store the store instance

getReificationMap

protected org.apache.commons.collections.bidimap.TreeBidiMap getReificationMap()
Returns:
the reification