de.topicmapslab.majortom.core
Class TopicMapImpl

java.lang.Object
  extended by de.topicmapslab.majortom.core.ConstructImpl
      extended by de.topicmapslab.majortom.core.ReifiableImpl
          extended by de.topicmapslab.majortom.core.TopicMapImpl
All Implemented Interfaces:
de.topicmapslab.majortom.model.core.IConstruct, de.topicmapslab.majortom.model.core.IReifiable, de.topicmapslab.majortom.model.core.ITopicMap, de.topicmapslab.majortom.model.core.paged.IPagedTopicMap, java.io.Serializable, java.lang.Comparable<de.topicmapslab.majortom.model.core.IConstruct>, org.tmapi.core.Construct, org.tmapi.core.Reifiable, org.tmapi.core.TopicMap
Direct Known Subclasses:
TransactionImpl

public class TopicMapImpl
extends ReifiableImpl
implements de.topicmapslab.majortom.model.core.ITopicMap, de.topicmapslab.majortom.model.core.paged.IPagedTopicMap

Base implementation of ITopicMap

Author:
Sven Krosse
See Also:
Serialized Form

Field Summary
private  org.tmapi.core.Locator locator
          the locator of the topic map
private static long serialVersionUID
           
private  de.topicmapslab.majortom.model.store.ITopicMapStore store
          the reference to the topic map store
private  de.topicmapslab.majortom.model.core.ITopicMapSystem topicMapSystem
          the parent topic map system
 
Constructor Summary
TopicMapImpl(de.topicmapslab.majortom.model.core.ITopicMapSystem topicMapSystem, org.tmapi.core.Locator locator)
          constructor
 
Method Summary
 void addTag(java.lang.String name)
          
 void addTag(java.lang.String name, java.util.Calendar timestamp)
          
 void addTopicMapListener(de.topicmapslab.majortom.model.event.ITopicMapListener listener)
          
 void clear()
          
 void close()
          
 org.tmapi.core.Association createAssociation(org.tmapi.core.Topic type, java.util.Collection<org.tmapi.core.Topic> themes)
          
 org.tmapi.core.Association createAssociation(org.tmapi.core.Topic type, org.tmapi.core.Topic... themes)
          
 org.tmapi.core.Locator createLocator(java.lang.String ref)
          
 de.topicmapslab.majortom.model.core.IScope createScope(java.util.Collection<org.tmapi.core.Topic> themes)
          
 de.topicmapslab.majortom.model.core.IScope createScope(org.tmapi.core.Topic... themes)
          
 org.tmapi.core.Topic createTopic()
          
 org.tmapi.core.Topic createTopicByItemIdentifier(org.tmapi.core.Locator identifier)
          
 org.tmapi.core.Topic createTopicBySubjectIdentifier(org.tmapi.core.Locator identifier)
          
 org.tmapi.core.Topic createTopicBySubjectLocator(org.tmapi.core.Locator locator)
          
 de.topicmapslab.majortom.model.transaction.ITransaction createTransaction()
          
 java.util.Set<org.tmapi.core.Association> getAssociations()
          
 java.util.List<org.tmapi.core.Association> getAssociations(int offset, int limit)
          
 java.util.List<org.tmapi.core.Association> getAssociations(int offset, int limit, java.util.Comparator<org.tmapi.core.Association> comparator)
          
<T extends org.tmapi.core.Association>
java.util.Collection<T>
getAssociations(de.topicmapslab.majortom.model.core.IScope scope)
          
<T extends org.tmapi.core.Association>
java.util.Collection<T>
getAssociations(org.tmapi.core.Topic type)
          
<T extends org.tmapi.core.Association>
java.util.Collection<T>
getAssociations(org.tmapi.core.Topic type, de.topicmapslab.majortom.model.core.IScope scope)
          
 org.tmapi.core.Construct getConstructById(java.lang.String id)
          
 org.tmapi.core.Construct getConstructByItemIdentifier(org.tmapi.core.Locator identifier)
          
 de.topicmapslab.majortom.model.store.ITopicMapStoreIdentity getIdentity()
          Returns the identity of this construct
<I extends org.tmapi.index.Index>
I
getIndex(java.lang.Class<I> clazz)
          
 org.tmapi.core.Locator getLocator()
          
 long getNumberOfAssociations()
          
 long getNumberOfTopics()
          
 de.topicmapslab.majortom.model.store.ITopicMapStore getStore()
          
 org.tmapi.core.Topic getTopicBySubjectIdentifier(org.tmapi.core.Locator identifier)
          
 org.tmapi.core.Topic getTopicBySubjectLocator(org.tmapi.core.Locator locator)
          
 de.topicmapslab.majortom.model.core.ITopicMap getTopicMap()
          
 de.topicmapslab.majortom.model.core.ITopicMapSystem getTopicMapSystem()
          
 java.util.Set<org.tmapi.core.Topic> getTopics()
          
 java.util.List<org.tmapi.core.Topic> getTopics(int offset, int limit)
          
 java.util.List<org.tmapi.core.Topic> getTopics(int offset, int limit, java.util.Comparator<org.tmapi.core.Topic> comparator)
          
<T extends org.tmapi.core.Topic>
java.util.Collection<T>
getTopics(org.tmapi.core.Topic type)
          
 void mergeIn(org.tmapi.core.TopicMap topicMap)
          
 void remove(boolean cascade)
          
 void removeDuplicates()
          
 void removeTopicMapListener(de.topicmapslab.majortom.model.event.ITopicMapListener listener)
          
 void setStore(de.topicmapslab.majortom.model.store.ITopicMapStore store)
          
 java.lang.String toString()
          
 
Methods inherited from class de.topicmapslab.majortom.core.ReifiableImpl
getReifier, setReifier
 
Methods inherited from class de.topicmapslab.majortom.core.ConstructImpl
addItemIdentifier, compareTo, equals, getId, getItemIdentifiers, getParent, hashCode, isRemoved, longId, remove, removeItemIdentifier, setRemoved
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.tmapi.core.TopicMap
getParent
 
Methods inherited from interface org.tmapi.core.Reifiable
getReifier, setReifier
 
Methods inherited from interface de.topicmapslab.majortom.model.core.IConstruct
isRemoved, longId
 
Methods inherited from interface org.tmapi.core.Construct
addItemIdentifier, equals, getId, getItemIdentifiers, hashCode, remove, removeItemIdentifier
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

store

private de.topicmapslab.majortom.model.store.ITopicMapStore store
the reference to the topic map store


locator

private final org.tmapi.core.Locator locator
the locator of the topic map


topicMapSystem

private final de.topicmapslab.majortom.model.core.ITopicMapSystem topicMapSystem
the parent topic map system

Constructor Detail

TopicMapImpl

public TopicMapImpl(de.topicmapslab.majortom.model.core.ITopicMapSystem topicMapSystem,
                    org.tmapi.core.Locator locator)
constructor

Parameters:
topicMapSystem - the parent topic map system
locator - the locator of the topicmap
Method Detail

addTag

public void addTag(java.lang.String name)

Specified by:
addTag in interface de.topicmapslab.majortom.model.core.ITopicMap

addTag

public void addTag(java.lang.String name,
                   java.util.Calendar timestamp)

Specified by:
addTag in interface de.topicmapslab.majortom.model.core.ITopicMap

addTopicMapListener

public void addTopicMapListener(de.topicmapslab.majortom.model.event.ITopicMapListener listener)

Specified by:
addTopicMapListener in interface de.topicmapslab.majortom.model.core.ITopicMap

getAssociations

public <T extends org.tmapi.core.Association> java.util.Collection<T> getAssociations(org.tmapi.core.Topic type)

Specified by:
getAssociations in interface de.topicmapslab.majortom.model.core.ITopicMap

getAssociations

public <T extends org.tmapi.core.Association> java.util.Collection<T> getAssociations(de.topicmapslab.majortom.model.core.IScope scope)

Specified by:
getAssociations in interface de.topicmapslab.majortom.model.core.ITopicMap

getAssociations

public <T extends org.tmapi.core.Association> java.util.Collection<T> getAssociations(org.tmapi.core.Topic type,
                                                                                      de.topicmapslab.majortom.model.core.IScope scope)

Specified by:
getAssociations in interface de.topicmapslab.majortom.model.core.ITopicMap

getAssociations

public java.util.List<org.tmapi.core.Association> getAssociations(int offset,
                                                                  int limit)

Specified by:
getAssociations in interface de.topicmapslab.majortom.model.core.paged.IPagedTopicMap

getAssociations

public java.util.List<org.tmapi.core.Association> getAssociations(int offset,
                                                                  int limit,
                                                                  java.util.Comparator<org.tmapi.core.Association> comparator)

Specified by:
getAssociations in interface de.topicmapslab.majortom.model.core.paged.IPagedTopicMap

getNumberOfAssociations

public long getNumberOfAssociations()

Specified by:
getNumberOfAssociations in interface de.topicmapslab.majortom.model.core.paged.IPagedTopicMap

getStore

public de.topicmapslab.majortom.model.store.ITopicMapStore getStore()

Specified by:
getStore in interface de.topicmapslab.majortom.model.core.ITopicMap

setStore

public void setStore(de.topicmapslab.majortom.model.store.ITopicMapStore store)


getTopics

public <T extends org.tmapi.core.Topic> java.util.Collection<T> getTopics(org.tmapi.core.Topic type)

Specified by:
getTopics in interface de.topicmapslab.majortom.model.core.ITopicMap

getTopics

public java.util.List<org.tmapi.core.Topic> getTopics(int offset,
                                                      int limit)

Specified by:
getTopics in interface de.topicmapslab.majortom.model.core.paged.IPagedTopicMap

getTopics

public java.util.List<org.tmapi.core.Topic> getTopics(int offset,
                                                      int limit,
                                                      java.util.Comparator<org.tmapi.core.Topic> comparator)

Specified by:
getTopics in interface de.topicmapslab.majortom.model.core.paged.IPagedTopicMap

getNumberOfTopics

public long getNumberOfTopics()

Specified by:
getNumberOfTopics in interface de.topicmapslab.majortom.model.core.paged.IPagedTopicMap

removeTopicMapListener

public void removeTopicMapListener(de.topicmapslab.majortom.model.event.ITopicMapListener listener)

Specified by:
removeTopicMapListener in interface de.topicmapslab.majortom.model.core.ITopicMap

close

public void close()

Specified by:
close in interface org.tmapi.core.TopicMap

createAssociation

public org.tmapi.core.Association createAssociation(org.tmapi.core.Topic type,
                                                    org.tmapi.core.Topic... themes)
                                             throws org.tmapi.core.ModelConstraintException

Specified by:
createAssociation in interface org.tmapi.core.TopicMap
Throws:
org.tmapi.core.ModelConstraintException

createAssociation

public org.tmapi.core.Association createAssociation(org.tmapi.core.Topic type,
                                                    java.util.Collection<org.tmapi.core.Topic> themes)
                                             throws org.tmapi.core.ModelConstraintException

Specified by:
createAssociation in interface org.tmapi.core.TopicMap
Throws:
org.tmapi.core.ModelConstraintException

createLocator

public org.tmapi.core.Locator createLocator(java.lang.String ref)
                                     throws org.tmapi.core.MalformedIRIException

Specified by:
createLocator in interface org.tmapi.core.TopicMap
Throws:
org.tmapi.core.MalformedIRIException

createTopic

public org.tmapi.core.Topic createTopic()

Specified by:
createTopic in interface org.tmapi.core.TopicMap

createTopicByItemIdentifier

public org.tmapi.core.Topic createTopicByItemIdentifier(org.tmapi.core.Locator identifier)
                                                 throws org.tmapi.core.IdentityConstraintException,
                                                        org.tmapi.core.ModelConstraintException

Specified by:
createTopicByItemIdentifier in interface org.tmapi.core.TopicMap
Throws:
org.tmapi.core.IdentityConstraintException
org.tmapi.core.ModelConstraintException

createTopicBySubjectIdentifier

public org.tmapi.core.Topic createTopicBySubjectIdentifier(org.tmapi.core.Locator identifier)
                                                    throws org.tmapi.core.ModelConstraintException

Specified by:
createTopicBySubjectIdentifier in interface org.tmapi.core.TopicMap
Throws:
org.tmapi.core.ModelConstraintException

createTopicBySubjectLocator

public org.tmapi.core.Topic createTopicBySubjectLocator(org.tmapi.core.Locator locator)
                                                 throws org.tmapi.core.ModelConstraintException

Specified by:
createTopicBySubjectLocator in interface org.tmapi.core.TopicMap
Throws:
org.tmapi.core.ModelConstraintException

getAssociations

public java.util.Set<org.tmapi.core.Association> getAssociations()

Specified by:
getAssociations in interface org.tmapi.core.TopicMap

getConstructById

public org.tmapi.core.Construct getConstructById(java.lang.String id)

Specified by:
getConstructById in interface org.tmapi.core.TopicMap

getConstructByItemIdentifier

public org.tmapi.core.Construct getConstructByItemIdentifier(org.tmapi.core.Locator identifier)

Specified by:
getConstructByItemIdentifier in interface org.tmapi.core.TopicMap

getIndex

public <I extends org.tmapi.index.Index> I getIndex(java.lang.Class<I> clazz)

Specified by:
getIndex in interface org.tmapi.core.TopicMap

getLocator

public org.tmapi.core.Locator getLocator()

Specified by:
getLocator in interface org.tmapi.core.TopicMap

getTopicBySubjectIdentifier

public org.tmapi.core.Topic getTopicBySubjectIdentifier(org.tmapi.core.Locator identifier)

Specified by:
getTopicBySubjectIdentifier in interface org.tmapi.core.TopicMap

getTopicBySubjectLocator

public org.tmapi.core.Topic getTopicBySubjectLocator(org.tmapi.core.Locator locator)

Specified by:
getTopicBySubjectLocator in interface org.tmapi.core.TopicMap

getTopics

public java.util.Set<org.tmapi.core.Topic> getTopics()

Specified by:
getTopics in interface org.tmapi.core.TopicMap

mergeIn

public void mergeIn(org.tmapi.core.TopicMap topicMap)
             throws org.tmapi.core.ModelConstraintException

Specified by:
mergeIn in interface org.tmapi.core.TopicMap
Throws:
org.tmapi.core.ModelConstraintException

remove

public void remove(boolean cascade)
            throws org.tmapi.core.TopicInUseException

Specified by:
remove in interface de.topicmapslab.majortom.model.core.IConstruct
Overrides:
remove in class ConstructImpl
Throws:
org.tmapi.core.TopicInUseException

getTopicMap

public de.topicmapslab.majortom.model.core.ITopicMap getTopicMap()

Specified by:
getTopicMap in interface de.topicmapslab.majortom.model.core.IConstruct
Specified by:
getTopicMap in interface org.tmapi.core.Construct
Overrides:
getTopicMap in class ConstructImpl

getIdentity

public de.topicmapslab.majortom.model.store.ITopicMapStoreIdentity getIdentity()
Returns the identity of this construct

Overrides:
getIdentity in class ConstructImpl
Returns:
the identity the ITopicMapStoreIdentity

createTransaction

public de.topicmapslab.majortom.model.transaction.ITransaction createTransaction()

Specified by:
createTransaction in interface de.topicmapslab.majortom.model.core.ITopicMap

getTopicMapSystem

public de.topicmapslab.majortom.model.core.ITopicMapSystem getTopicMapSystem()

Specified by:
getTopicMapSystem in interface de.topicmapslab.majortom.model.core.ITopicMap

createScope

public de.topicmapslab.majortom.model.core.IScope createScope(java.util.Collection<org.tmapi.core.Topic> themes)

Specified by:
createScope in interface de.topicmapslab.majortom.model.core.ITopicMap

createScope

public de.topicmapslab.majortom.model.core.IScope createScope(org.tmapi.core.Topic... themes)

Specified by:
createScope in interface de.topicmapslab.majortom.model.core.ITopicMap

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

removeDuplicates

public void removeDuplicates()

Specified by:
removeDuplicates in interface de.topicmapslab.majortom.model.core.ITopicMap

clear

public void clear()

Specified by:
clear in interface de.topicmapslab.majortom.model.core.ITopicMap
Specified by:
clear in interface org.tmapi.core.TopicMap