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

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

public class TypedStore
extends java.lang.Object
implements IDataStore

Internal data store of type-typed relations

Author:
Sven Krosse

Field Summary
private  java.util.Map<de.topicmapslab.majortom.model.core.IAssociation,de.topicmapslab.majortom.model.core.ITopic> associationTypes
          storage map of the association-type relation
private  java.util.Map<de.topicmapslab.majortom.model.core.IName,de.topicmapslab.majortom.model.core.ITopic> nameTypes
          storage map of the name-type relation
private  java.util.Map<de.topicmapslab.majortom.model.core.IOccurrence,de.topicmapslab.majortom.model.core.ITopic> occurrenceTypes
          storage map of the occurrence-type relation
private  java.util.Map<de.topicmapslab.majortom.model.core.IAssociationRole,de.topicmapslab.majortom.model.core.ITopic> roleTypes
          storage map of the role-type relation
private  InMemoryTopicMapStore store
          the parent store
private  java.util.Map<de.topicmapslab.majortom.model.core.ITopic,java.util.Set<de.topicmapslab.majortom.model.core.IAssociation>> typedAssociations
          storage map of the type-association relation
private  java.util.Map<de.topicmapslab.majortom.model.core.ITopic,java.util.Set<de.topicmapslab.majortom.model.core.IName>> typedNames
          storage map of the type-name relation
private  java.util.Map<de.topicmapslab.majortom.model.core.ITopic,java.util.Set<de.topicmapslab.majortom.model.core.IOccurrence>> typedOccurrences
          storage map of the type-occurrence relation
private  java.util.Map<de.topicmapslab.majortom.model.core.ITopic,java.util.Set<de.topicmapslab.majortom.model.core.IAssociationRole>> typedRoles
          storage map of the type-role relation
 
Constructor Summary
TypedStore(InMemoryTopicMapStore store)
          constructor
 
Method Summary
 void close()
          Remove all items from the internal store.
 java.util.Set<de.topicmapslab.majortom.model.core.ITopic> getAssociationTypes()
          Return a set containing all topic types used as type of an association item.
protected  java.util.Map<de.topicmapslab.majortom.model.core.IAssociation,de.topicmapslab.majortom.model.core.ITopic> getAssociationTypesMap()
          storage map of the association-type relation
 java.util.Set<de.topicmapslab.majortom.model.core.ITopic> getCharacteristicTypes()
          Return a set containing all topic types used as type of a characteristics item.
 java.util.Set<de.topicmapslab.majortom.model.core.ITopic> getNameTypes()
          Return a set containing all topic types used as type of a name item.
protected  java.util.Map<de.topicmapslab.majortom.model.core.IName,de.topicmapslab.majortom.model.core.ITopic> getNameTypesMap()
          storage map of the name-type relation
 java.util.Set<de.topicmapslab.majortom.model.core.ITopic> getOccurrenceTypes()
          Return a set containing all topic types used as type of an occurrence item.
protected  java.util.Map<de.topicmapslab.majortom.model.core.IOccurrence,de.topicmapslab.majortom.model.core.ITopic> getOccurrenceTypesMap()
          storage map of the occurrence-type relation
 java.util.Set<de.topicmapslab.majortom.model.core.ITopic> getRoleTypes()
          Return a set containing all topic types used as type of a role item.
protected  java.util.Map<de.topicmapslab.majortom.model.core.IAssociationRole,de.topicmapslab.majortom.model.core.ITopic> getRoleTypesMap()
          storage map of the role-type relation
protected  InMemoryTopicMapStore getStore()
          Return the internal stored store instance.
 de.topicmapslab.majortom.model.core.ITopic getType(de.topicmapslab.majortom.model.core.IAssociation typed)
          Return the type of the typed attribute
 de.topicmapslab.majortom.model.core.ITopic getType(de.topicmapslab.majortom.model.core.IAssociationRole typed)
          Return the type of the typed attribute
 de.topicmapslab.majortom.model.core.ITopic getType(de.topicmapslab.majortom.model.core.IName typed)
          Return the type of the typed attribute
 de.topicmapslab.majortom.model.core.ITopic getType(de.topicmapslab.majortom.model.core.IOccurrence typed)
          Return the type of the typed attribute
 de.topicmapslab.majortom.model.core.ITopic getType(org.tmapi.core.Typed typed)
          Return the type of the typed attribute
 java.util.Set<de.topicmapslab.majortom.model.core.ITypeable> getTyped(de.topicmapslab.majortom.model.core.ITopic t)
          Returns the typed items of the given type.
 java.util.Set<de.topicmapslab.majortom.model.core.IAssociation> getTypedAssociations(de.topicmapslab.majortom.model.core.ITopic t)
          Returns the typed items of the given type.
protected  java.util.Map<de.topicmapslab.majortom.model.core.ITopic,java.util.Set<de.topicmapslab.majortom.model.core.IAssociation>> getTypedAssociationsMap()
          storage map of the type-association relation
 java.util.Set<de.topicmapslab.majortom.model.core.ICharacteristics> getTypedCharacteristics(de.topicmapslab.majortom.model.core.ITopic t)
          Returns the typed names items of the given type.
 java.util.Set<de.topicmapslab.majortom.model.core.IName> getTypedNames(de.topicmapslab.majortom.model.core.ITopic t)
          Returns the typed names items of the given type.
protected  java.util.Map<de.topicmapslab.majortom.model.core.ITopic,java.util.Set<de.topicmapslab.majortom.model.core.IName>> getTypedNamesMap()
          storage map of the type-name relation
 java.util.Set<de.topicmapslab.majortom.model.core.IOccurrence> getTypedOccurrences(de.topicmapslab.majortom.model.core.ITopic t)
          Returns the typed names items of the given type.
protected  java.util.Map<de.topicmapslab.majortom.model.core.ITopic,java.util.Set<de.topicmapslab.majortom.model.core.IOccurrence>> getTypedOccurrencesMap()
          storage map of the type-occurrence relation
 java.util.Set<de.topicmapslab.majortom.model.core.IAssociationRole> getTypedRoles(de.topicmapslab.majortom.model.core.ITopic t)
          Returns the typed association role items of the given type.
protected  java.util.Map<de.topicmapslab.majortom.model.core.ITopic,java.util.Set<de.topicmapslab.majortom.model.core.IAssociationRole>> getTypedRolesMap()
          storage map of the type-role relation
 de.topicmapslab.majortom.model.core.ITopic removeType(de.topicmapslab.majortom.model.core.IAssociation typed)
          Remove the given type for the typed attribute
 de.topicmapslab.majortom.model.core.ITopic removeType(de.topicmapslab.majortom.model.core.IAssociationRole typed)
          Remove the given type for the typed attribute
 de.topicmapslab.majortom.model.core.ITopic removeType(de.topicmapslab.majortom.model.core.IName typed)
          Remove the given type for the typed attribute
 de.topicmapslab.majortom.model.core.ITopic removeType(de.topicmapslab.majortom.model.core.IOccurrence typed)
          Remove the given type for the typed attribute
 java.util.Set<de.topicmapslab.majortom.model.core.ITypeable> removeType(de.topicmapslab.majortom.model.core.ITopic type)
          Removing the given topic as type of each stored typed.
 de.topicmapslab.majortom.model.core.ITopic removeType(org.tmapi.core.Typed typed)
          Remove the given type for the typed attribute
 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.
 void setType(de.topicmapslab.majortom.model.core.IAssociation typed, de.topicmapslab.majortom.model.core.ITopic t)
          Store the given type for the typed attribute
 void setType(de.topicmapslab.majortom.model.core.IAssociationRole typed, de.topicmapslab.majortom.model.core.ITopic t)
          Store the given type for the typed attribute
 void setType(de.topicmapslab.majortom.model.core.IName typed, de.topicmapslab.majortom.model.core.ITopic t)
          Store the given type for the typed attribute
 void setType(de.topicmapslab.majortom.model.core.IOccurrence typed, de.topicmapslab.majortom.model.core.ITopic t)
          Store the given type for the typed attribute
 void setType(org.tmapi.core.Typed typed, de.topicmapslab.majortom.model.core.ITopic t)
          Store the given type for the typed attribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

typedNames

private java.util.Map<de.topicmapslab.majortom.model.core.ITopic,java.util.Set<de.topicmapslab.majortom.model.core.IName>> typedNames
storage map of the type-name relation


nameTypes

private java.util.Map<de.topicmapslab.majortom.model.core.IName,de.topicmapslab.majortom.model.core.ITopic> nameTypes
storage map of the name-type relation


typedOccurrences

private java.util.Map<de.topicmapslab.majortom.model.core.ITopic,java.util.Set<de.topicmapslab.majortom.model.core.IOccurrence>> typedOccurrences
storage map of the type-occurrence relation


occurrenceTypes

private java.util.Map<de.topicmapslab.majortom.model.core.IOccurrence,de.topicmapslab.majortom.model.core.ITopic> occurrenceTypes
storage map of the occurrence-type relation


typedAssociations

private java.util.Map<de.topicmapslab.majortom.model.core.ITopic,java.util.Set<de.topicmapslab.majortom.model.core.IAssociation>> typedAssociations
storage map of the type-association relation


associationTypes

private java.util.Map<de.topicmapslab.majortom.model.core.IAssociation,de.topicmapslab.majortom.model.core.ITopic> associationTypes
storage map of the association-type relation


typedRoles

private java.util.Map<de.topicmapslab.majortom.model.core.ITopic,java.util.Set<de.topicmapslab.majortom.model.core.IAssociationRole>> typedRoles
storage map of the type-role relation


roleTypes

private java.util.Map<de.topicmapslab.majortom.model.core.IAssociationRole,de.topicmapslab.majortom.model.core.ITopic> roleTypes
storage map of the role-type relation


store

private final InMemoryTopicMapStore store
the parent store

Constructor Detail

TypedStore

public TypedStore(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

removeType

public de.topicmapslab.majortom.model.core.ITopic removeType(org.tmapi.core.Typed typed)
Remove the given type for the typed attribute

Parameters:
typed - the typed item
Returns:
the removed type

removeType

public de.topicmapslab.majortom.model.core.ITopic removeType(de.topicmapslab.majortom.model.core.IName typed)
Remove the given type for the typed attribute

Parameters:
typed - the typed item
Returns:
the removed type

removeType

public de.topicmapslab.majortom.model.core.ITopic removeType(de.topicmapslab.majortom.model.core.IOccurrence typed)
Remove the given type for the typed attribute

Parameters:
typed - the typed item
Returns:
the removed type

removeType

public de.topicmapslab.majortom.model.core.ITopic removeType(de.topicmapslab.majortom.model.core.IAssociation typed)
Remove the given type for the typed attribute

Parameters:
typed - the typed item
Returns:
the removed type

removeType

public de.topicmapslab.majortom.model.core.ITopic removeType(de.topicmapslab.majortom.model.core.IAssociationRole typed)
Remove the given type for the typed attribute

Parameters:
typed - the typed item
Returns:
the removed type

setType

public void setType(org.tmapi.core.Typed typed,
                    de.topicmapslab.majortom.model.core.ITopic t)
Store the given type for the typed attribute

Parameters:
typed - the typed item
t - the topic

setType

public void setType(de.topicmapslab.majortom.model.core.IName typed,
                    de.topicmapslab.majortom.model.core.ITopic t)
Store the given type for the typed attribute

Parameters:
typed - the typed item
t - the topic

setType

public void setType(de.topicmapslab.majortom.model.core.IOccurrence typed,
                    de.topicmapslab.majortom.model.core.ITopic t)
Store the given type for the typed attribute

Parameters:
typed - the typed item
t - the topic

setType

public void setType(de.topicmapslab.majortom.model.core.IAssociation typed,
                    de.topicmapslab.majortom.model.core.ITopic t)
Store the given type for the typed attribute

Parameters:
typed - the typed item
t - the topic

setType

public void setType(de.topicmapslab.majortom.model.core.IAssociationRole typed,
                    de.topicmapslab.majortom.model.core.ITopic t)
Store the given type for the typed attribute

Parameters:
typed - the typed item
t - the topic

getType

public de.topicmapslab.majortom.model.core.ITopic getType(org.tmapi.core.Typed typed)
Return the type of the typed attribute

Parameters:
typed - the typed item
Returns:
the type

getType

public de.topicmapslab.majortom.model.core.ITopic getType(de.topicmapslab.majortom.model.core.IName typed)
Return the type of the typed attribute

Parameters:
typed - the typed item
Returns:
the type

getType

public de.topicmapslab.majortom.model.core.ITopic getType(de.topicmapslab.majortom.model.core.IOccurrence typed)
Return the type of the typed attribute

Parameters:
typed - the typed item
Returns:
the type

getType

public de.topicmapslab.majortom.model.core.ITopic getType(de.topicmapslab.majortom.model.core.IAssociation typed)
Return the type of the typed attribute

Parameters:
typed - the typed item
Returns:
the type

getType

public de.topicmapslab.majortom.model.core.ITopic getType(de.topicmapslab.majortom.model.core.IAssociationRole typed)
Return the type of the typed attribute

Parameters:
typed - the typed item
Returns:
the type

getTyped

public java.util.Set<de.topicmapslab.majortom.model.core.ITypeable> getTyped(de.topicmapslab.majortom.model.core.ITopic t)
Returns the typed items of the given type.

Parameters:
t - the type
Returns:
a set containing all typed attributes

getTypedAssociations

public java.util.Set<de.topicmapslab.majortom.model.core.IAssociation> getTypedAssociations(de.topicmapslab.majortom.model.core.ITopic t)
Returns the typed items of the given type.

Parameters:
t - the type
Returns:
a set containing all typed attributes

getTypedRoles

public java.util.Set<de.topicmapslab.majortom.model.core.IAssociationRole> getTypedRoles(de.topicmapslab.majortom.model.core.ITopic t)
Returns the typed association role items of the given type.

Parameters:
t - the type
Returns:
a set containing all typed association role items

getTypedCharacteristics

public java.util.Set<de.topicmapslab.majortom.model.core.ICharacteristics> getTypedCharacteristics(de.topicmapslab.majortom.model.core.ITopic t)
Returns the typed names items of the given type.

Parameters:
t - the type
Returns:
a set containing all typed characteristics

getTypedNames

public java.util.Set<de.topicmapslab.majortom.model.core.IName> getTypedNames(de.topicmapslab.majortom.model.core.ITopic t)
Returns the typed names items of the given type.

Parameters:
t - the type
Returns:
a set containing all typed characteristics

getTypedOccurrences

public java.util.Set<de.topicmapslab.majortom.model.core.IOccurrence> getTypedOccurrences(de.topicmapslab.majortom.model.core.ITopic t)
Returns the typed names items of the given type.

Parameters:
t - the type
Returns:
a set containing all typed characteristics

removeType

public java.util.Set<de.topicmapslab.majortom.model.core.ITypeable> removeType(de.topicmapslab.majortom.model.core.ITopic type)
Removing the given topic as type of each stored typed. The typed objects will be removed too.

Parameters:
type - the type
Returns:
the removed typed items

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

getCharacteristicTypes

public java.util.Set<de.topicmapslab.majortom.model.core.ITopic> getCharacteristicTypes()
Return a set containing all topic types used as type of a characteristics item.

Returns:
a set of all types

getRoleTypes

public java.util.Set<de.topicmapslab.majortom.model.core.ITopic> getRoleTypes()
Return a set containing all topic types used as type of a role item.

Returns:
a set of all types

getAssociationTypes

public java.util.Set<de.topicmapslab.majortom.model.core.ITopic> getAssociationTypes()
Return a set containing all topic types used as type of an association item.

Returns:
a set of all types

getNameTypes

public java.util.Set<de.topicmapslab.majortom.model.core.ITopic> getNameTypes()
Return a set containing all topic types used as type of a name item.

Returns:
a set of all types

getOccurrenceTypes

public java.util.Set<de.topicmapslab.majortom.model.core.ITopic> getOccurrenceTypes()
Return a set containing all topic types used as type of an occurrence item.

Returns:
a set of all types

getStore

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

Returns:
the store the store instance

getTypedNamesMap

protected java.util.Map<de.topicmapslab.majortom.model.core.ITopic,java.util.Set<de.topicmapslab.majortom.model.core.IName>> getTypedNamesMap()
storage map of the type-name relation


getNameTypesMap

protected java.util.Map<de.topicmapslab.majortom.model.core.IName,de.topicmapslab.majortom.model.core.ITopic> getNameTypesMap()
storage map of the name-type relation


getTypedOccurrencesMap

protected java.util.Map<de.topicmapslab.majortom.model.core.ITopic,java.util.Set<de.topicmapslab.majortom.model.core.IOccurrence>> getTypedOccurrencesMap()
storage map of the type-occurrence relation


getOccurrenceTypesMap

protected java.util.Map<de.topicmapslab.majortom.model.core.IOccurrence,de.topicmapslab.majortom.model.core.ITopic> getOccurrenceTypesMap()
storage map of the occurrence-type relation


getTypedAssociationsMap

protected java.util.Map<de.topicmapslab.majortom.model.core.ITopic,java.util.Set<de.topicmapslab.majortom.model.core.IAssociation>> getTypedAssociationsMap()
storage map of the type-association relation


getAssociationTypesMap

protected java.util.Map<de.topicmapslab.majortom.model.core.IAssociation,de.topicmapslab.majortom.model.core.ITopic> getAssociationTypesMap()
storage map of the association-type relation


getTypedRolesMap

protected java.util.Map<de.topicmapslab.majortom.model.core.ITopic,java.util.Set<de.topicmapslab.majortom.model.core.IAssociationRole>> getTypedRolesMap()
storage map of the type-role relation


getRoleTypesMap

protected java.util.Map<de.topicmapslab.majortom.model.core.IAssociationRole,de.topicmapslab.majortom.model.core.ITopic> getRoleTypesMap()
storage map of the role-type relation