Package net.ontopia.topicmaps.impl.rdbms
Class TopicMap
- java.lang.Object
-
- net.ontopia.persistence.proxy.AbstractRWPersistent
-
- net.ontopia.topicmaps.impl.rdbms.TMObject
-
- net.ontopia.topicmaps.impl.rdbms.TopicMap
-
- All Implemented Interfaces:
PersistentIF
,ReifiableIF
,TMObjectIF
,TopicMapIF
public class TopicMap extends TMObject implements TopicMapIF
INTERNAL: The rdbms topic map implementation.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLASS_INDICATOR
protected static String[]
fields
protected static int
LF_base_address
protected static int
LF_comments
protected static int
LF_reifier
protected static int
LF_sources
protected static int
LF_title
protected RDBMSTopicMapTransaction
transaction
-
Fields inherited from class net.ontopia.topicmaps.impl.rdbms.TMObject
LF_topicmap
-
Fields inherited from class net.ontopia.persistence.proxy.AbstractRWPersistent
id, MASKS, txn, values
-
Fields inherited from interface net.ontopia.topicmaps.core.ReifiableIF
EVENT_SET_REIFIER
-
Fields inherited from interface net.ontopia.topicmaps.core.TMObjectIF
EVENT_ADD_ITEMIDENTIFIER, EVENT_REMOVE_ITEMIDENTIFIER, MSG_NULL_ARGUMENT
-
Fields inherited from interface net.ontopia.topicmaps.core.TopicMapIF
EVENT_ADD_ASSOCIATION, EVENT_ADD_TOPIC, EVENT_REMOVE_ASSOCIATION, EVENT_REMOVE_TOPIC
-
-
Constructor Summary
Constructors Constructor Description TopicMap()
TopicMap(TransactionIF txn)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
_p_getFieldCount()
protected void
addAssociation(AssociationIF association)
Adds an association to the set of associations.protected void
addTopic(TopicIF topic)
Adds a topic to the set of topics.void
clear()
PUBLIC: Clears the topic map by removing all topics and associations.void
detach()
Collection<AssociationIF>
getAssocations(TopicIF topic)
Collection<AssociationIF>
getAssociations()
PUBLIC: Gets all associations in this topic map.Collection<AssociationIF>
getAssociationsByType(TopicIF topic, TopicIF type)
LocatorIF
getBaseAddress()
TopicMapBuilderIF
getBuilder()
PUBLIC: Gets a topic map builder for use with this transaction.String
getClassIndicator()
INTERNAL: Returns the token that can be used to indicate the class of this instance.String
getComments()
Object
getIndex(String name)
PUBLIC: Gets an index by name.TMObjectIF
getObjectById(String object_id)
PUBLIC: Gets the topic map object that has the given object id, from this topic map.TMObjectIF
getObjectByItemIdentifier(LocatorIF locator)
PUBLIC: Gets the topic map object that has the given item identifier (given as a LocatorIF object), from this topic map.String
getObjectId()
PUBLIC: Gets the id of this object.Collection<OccurrenceIF>
getOccurrencesByType(TopicIF topic, TopicIF type)
TopicIF
getReifier()
PUBLIC: Returns the topic that reifies this object.Collection<AssociationRoleIF>
getRolesByType(TopicIF player, TopicIF rtype)
Collection<AssociationRoleIF>
getRolesByType(TopicIF player, TopicIF rtype, TopicIF atype)
TopicMapStoreIF
getStore()
PUBLIC: Gets the store to which the topic map's transaction is connected.String
getTitle()
TopicIF
getTopicBySubjectIdentifier(LocatorIF locator)
PUBLIC: Gets the topic that has the specified subject identifier, given as a locator.TopicIF
getTopicBySubjectLocator(LocatorIF locator)
PUBLIC: Gets the topic in this topic map that represents the given addressable subject (locator given as a LocatorIF object).TopicMapIF
getTopicMap()
PUBLIC: Gets the topic map that this object belongs to.Collection<TopicNameIF>
getTopicNamesByType(TopicIF topic, TopicIF type)
Collection<TopicIF>
getTopics()
PUBLIC: Gets all topics in this topic map.TopicMapTransactionIF
getTransaction()
void
remove()
PUBLIC: Removes the object from its parent.protected void
removeAssociation(AssociationIF association)
Removes an associations from the set of associations.protected void
removeTopic(TopicIF topic)
Removes a topic from the set of topics.void
setBaseAddress(LocatorIF baseAddress)
void
setComments(String comments)
void
setReifier(TopicIF _reifier)
PUBLIC: Sets the reifier of this object.void
setTitle(String title)
protected void
setTopicMap(TopicMapIF topicmap)
void
setTransaction(RDBMSTopicMapTransaction transaction)
void
syncAfterMerge(IdentityIF source, IdentityIF target)
String
toString()
-
Methods inherited from class net.ontopia.topicmaps.impl.rdbms.TMObject
addItemIdentifier, fireEvent, getItemIdentifiers, getLongId, isReadOnly, removeItemIdentifier, transactionChanged
-
Methods inherited from class net.ontopia.persistence.proxy.AbstractRWPersistent
_p_getIdentity, _p_getTransaction, _p_getType, _p_setIdentity, _p_setTransaction, _p_toString, clearAll, detachCollectionField, detachField, executeQuery, getValue, isDeleted, isDirty, isDirty, isDirtyFlushed, isDirtyFlushed, isInDatabase, isLoaded, isNewObject, isPersistent, isTransient, loadCollectionField, loadField, loadFieldNoCheck, loadValue, nextDirty, nextDirty, nextDirtyFlushed, nextDirtyFlushed, setDeleted, setDirty, setDirtyFlushed, setInDatabase, setNewObject, setPersistent, setValue, syncFieldsAfterMerge, unsetValue, valueAdded, valueChanged, valueRemoved
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.ontopia.topicmaps.core.TMObjectIF
addItemIdentifier, getItemIdentifiers, isReadOnly, removeItemIdentifier
-
-
-
-
Field Detail
-
CLASS_INDICATOR
public static final String CLASS_INDICATOR
- See Also:
- Constant Field Values
-
LF_sources
protected static final int LF_sources
- See Also:
- Constant Field Values
-
LF_title
protected static final int LF_title
- See Also:
- Constant Field Values
-
LF_base_address
protected static final int LF_base_address
- See Also:
- Constant Field Values
-
LF_comments
protected static final int LF_comments
- See Also:
- Constant Field Values
-
LF_reifier
protected static final int LF_reifier
- See Also:
- Constant Field Values
-
fields
protected static final String[] fields
-
transaction
protected transient RDBMSTopicMapTransaction transaction
-
-
Constructor Detail
-
TopicMap
public TopicMap()
-
TopicMap
public TopicMap(TransactionIF txn)
-
-
Method Detail
-
detach
public void detach()
- Specified by:
detach
in interfacePersistentIF
- Specified by:
detach
in classAbstractRWPersistent
-
getBaseAddress
public LocatorIF getBaseAddress()
-
setBaseAddress
public void setBaseAddress(LocatorIF baseAddress)
-
getTitle
public String getTitle()
-
setTitle
public void setTitle(String title)
-
getComments
public String getComments()
-
setComments
public void setComments(String comments)
-
_p_getFieldCount
public int _p_getFieldCount()
- Specified by:
_p_getFieldCount
in interfacePersistentIF
-
getClassIndicator
public String getClassIndicator()
Description copied from class:TMObject
INTERNAL: Returns the token that can be used to indicate the class of this instance. This indicator is currently only used by source locators.- Specified by:
getClassIndicator
in classTMObject
-
getObjectId
public String getObjectId()
Description copied from interface:TMObjectIF
PUBLIC: Gets the id of this object. The object id is part of the topic map id space, and must be unique. The object id is not significant (or unique) outside the current topic map. The object id is immutable. The object id is thus stable through this object's lifetime.- Specified by:
getObjectId
in interfaceTMObjectIF
- Specified by:
getObjectId
in classTMObject
- Returns:
- string which is this object's id.
-
getTopicMap
public TopicMapIF getTopicMap()
Description copied from interface:TMObjectIF
PUBLIC: Gets the topic map that this object belongs to. If the object has been removed from its topic map or not added to a topic map yet this will be null.- Specified by:
getTopicMap
in interfaceTMObjectIF
- Overrides:
getTopicMap
in classTMObject
- Returns:
- A topic map; an object implementing TopicMapIF.
-
setTopicMap
protected void setTopicMap(TopicMapIF topicmap)
-
getStore
public TopicMapStoreIF getStore()
Description copied from interface:TopicMapIF
PUBLIC: Gets the store to which the topic map's transaction is connected.- Specified by:
getStore
in interfaceTopicMapIF
-
getTransaction
public TopicMapTransactionIF getTransaction()
-
getBuilder
public TopicMapBuilderIF getBuilder()
Description copied from interface:TopicMapIF
PUBLIC: Gets a topic map builder for use with this transaction.- Specified by:
getBuilder
in interfaceTopicMapIF
- Returns:
- An object implementing TopicMapBuilderIF
-
getIndex
public Object getIndex(String name)
Description copied from interface:TopicMapIF
PUBLIC: Gets an index by name. An index is usually named by the IndexIF subinterface that it implements. All indexes are kept up-to-date at all times.- Specified by:
getIndex
in interfaceTopicMapIF
- Parameters:
name
- A string; the index name, i.e.g the interface that it implements.- Returns:
- An instance implementing the index interface.
-
setTransaction
public void setTransaction(RDBMSTopicMapTransaction transaction)
-
getTopics
public Collection<TopicIF> getTopics()
Description copied from interface:TopicMapIF
PUBLIC: Gets all topics in this topic map. No specific order is guaranteed.- Specified by:
getTopics
in interfaceTopicMapIF
- Returns:
- A collection of TopicIF objects.
-
addTopic
protected void addTopic(TopicIF topic)
Adds a topic to the set of topics.
-
removeTopic
protected void removeTopic(TopicIF topic)
Removes a topic from the set of topics.
-
getAssociations
public Collection<AssociationIF> getAssociations()
Description copied from interface:TopicMapIF
PUBLIC: Gets all associations in this topic map. No specific order is guaranteed.- Specified by:
getAssociations
in interfaceTopicMapIF
- Returns:
- A collection of AssociationIF objects.
-
addAssociation
protected void addAssociation(AssociationIF association)
Adds an association to the set of associations.
-
removeAssociation
protected void removeAssociation(AssociationIF association)
Removes an associations from the set of associations.
-
getObjectById
public TMObjectIF getObjectById(String object_id)
Description copied from interface:TopicMapIF
PUBLIC: Gets the topic map object that has the given object id, from this topic map. If there is no object with that object id in this topic map, then null is returned.- Specified by:
getObjectById
in interfaceTopicMapIF
- Parameters:
object_id
- A string; the object id of the object to get.- Returns:
- A topic map object; an object implementing TMObjectIF.
-
remove
public void remove()
Description copied from interface:TMObjectIF
PUBLIC: Removes the object from its parent.- Specified by:
remove
in interfaceTMObjectIF
-
clear
public void clear()
Description copied from interface:TopicMapIF
PUBLIC: Clears the topic map by removing all topics and associations.- Specified by:
clear
in interfaceTopicMapIF
-
getObjectByItemIdentifier
public TMObjectIF getObjectByItemIdentifier(LocatorIF locator)
Description copied from interface:TopicMapIF
PUBLIC: Gets the topic map object that has the given item identifier (given as a LocatorIF object), from this topic map. If there is no object with the given locator in this topic map, null is returned.- Specified by:
getObjectByItemIdentifier
in interfaceTopicMapIF
- Parameters:
locator
- The given locator; an object implementing LocatorIF.- Returns:
- A topic map object; an object implementing TMObjectIF.
-
getTopicBySubjectLocator
public TopicIF getTopicBySubjectLocator(LocatorIF locator)
Description copied from interface:TopicMapIF
PUBLIC: Gets the topic in this topic map that represents the given addressable subject (locator given as a LocatorIF object). If there is no topic that represents the given addressable subject in this topic map, null is returned.- Specified by:
getTopicBySubjectLocator
in interfaceTopicMapIF
- Parameters:
locator
- The given locator; an object implementing LocatorIF.- Returns:
- A topic; an object implementing TopicIF.
-
getTopicBySubjectIdentifier
public TopicIF getTopicBySubjectIdentifier(LocatorIF locator)
Description copied from interface:TopicMapIF
PUBLIC: Gets the topic that has the specified subject identifier, given as a locator. If there is no topic that has that subject identifier in this topic map, null is returned.- Specified by:
getTopicBySubjectIdentifier
in interfaceTopicMapIF
- Parameters:
locator
- The given locator; an object implementing LocatorIF.- Returns:
- A topic; an object implementing TopicIF.
-
getRolesByType
public Collection<AssociationRoleIF> getRolesByType(TopicIF player, TopicIF rtype)
-
getRolesByType
public Collection<AssociationRoleIF> getRolesByType(TopicIF player, TopicIF rtype, TopicIF atype)
-
getOccurrencesByType
public Collection<OccurrenceIF> getOccurrencesByType(TopicIF topic, TopicIF type)
-
getTopicNamesByType
public Collection<TopicNameIF> getTopicNamesByType(TopicIF topic, TopicIF type)
-
getAssocations
public Collection<AssociationIF> getAssocations(TopicIF topic)
-
getAssociationsByType
public Collection<AssociationIF> getAssociationsByType(TopicIF topic, TopicIF type)
-
getReifier
public TopicIF getReifier()
Description copied from interface:ReifiableIF
PUBLIC: Returns the topic that reifies this object.- Specified by:
getReifier
in interfaceReifiableIF
-
setReifier
public void setReifier(TopicIF _reifier)
Description copied from interface:ReifiableIF
PUBLIC: Sets the reifier of this object.- Specified by:
setReifier
in interfaceReifiableIF
-
syncAfterMerge
public void syncAfterMerge(IdentityIF source, IdentityIF target)
- Specified by:
syncAfterMerge
in classAbstractRWPersistent
-
-