Package net.ontopia.topicmaps.impl.basic
Class Topic
- java.lang.Object
-
- net.ontopia.topicmaps.impl.basic.TMObject
-
- net.ontopia.topicmaps.impl.basic.Topic
-
- All Implemented Interfaces:
Serializable
,TMObjectIF
,TopicIF
- Direct Known Subclasses:
RemoteTopic
public class Topic extends TMObject implements TopicIF
INTERNAL: The basic topic implementation.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<LocatorIF>
indicators
protected Set<TopicNameIF>
names
protected Set<OccurrenceIF>
occurs
protected ReifiableIF
reified
protected Set<AssociationRoleIF>
roles
protected UniqueSet<TopicIF>
scope
protected Set<LocatorIF>
subjects
protected UniqueSet<TopicIF>
types
-
Fields inherited from class net.ontopia.topicmaps.impl.basic.TMObject
oid, parent, sources, topicmap
-
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.TopicIF
EVENT_ADD_OCCURRENCE, EVENT_ADD_SUBJECTIDENTIFIER, EVENT_ADD_SUBJECTLOCATOR, EVENT_ADD_TOPICNAME, EVENT_ADD_TYPE, EVENT_ADDED, EVENT_MODIFIED, EVENT_REMOVE_OCCURRENCE, EVENT_REMOVE_SUBJECTIDENTIFIER, EVENT_REMOVE_SUBJECTLOCATOR, EVENT_REMOVE_TOPICNAME, EVENT_REMOVE_TYPE, EVENT_REMOVED
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addOccurrence(OccurrenceIF _occurrence)
protected void
addRole(AssociationRoleIF assoc_role)
INTERNAL: Adds the association role to the set of association roles in which the topic participates.void
addSubjectIdentifier(LocatorIF subject_indicator)
PUBLIC: Adds the given subject identifier to the set of subject identifiers for this topic.void
addSubjectLocator(LocatorIF subject_locator)
PUBLIC: Adds the given subject locator to the set of subject locators for this topic.protected void
addTopicName(TopicNameIF _name)
void
addType(TopicIF type)
PUBLIC: Adds a type to this topic.Collection<AssociationIF>
getAssociations()
PUBLIC: Gets the associations that have roles played by this topic.Collection<AssociationIF>
getAssociationsByType(TopicIF type)
PUBLIC: Gets the associations that have roles played by this topic, where the association is of specified type.Collection<OccurrenceIF>
getOccurrences()
PUBLIC: Gets the occurrences of this topic.Collection<OccurrenceIF>
getOccurrencesByType(TopicIF type)
PUBLIC: Gets the occurrences of this topic with a specified type.ReifiableIF
getReified()
PUBLIC: Returns the topic map object that this topic reifies.Collection<AssociationRoleIF>
getRoles()
PUBLIC: Gets the association roles played by this topic.Collection<AssociationRoleIF>
getRolesByType(TopicIF roletype)
PUBLIC: Gets the association roles of the specifed type played by this topic.Collection<AssociationRoleIF>
getRolesByType(TopicIF roletype, TopicIF assoc_type)
PUBLIC: Gets the association roles of the specifed type played by this topic.Collection<LocatorIF>
getSubjectIdentifiers()
PUBLIC: Gets the subject identitifers of this topic.Collection<LocatorIF>
getSubjectLocators()
PUBLIC: Gets the subject locators of this topic.Collection<TopicNameIF>
getTopicNames()
PUBLIC: Gets the names of this topic.Collection<TopicNameIF>
getTopicNamesByType(TopicIF type)
PUBLIC: Gets the topic names of this topic with a specified type.Collection<TopicIF>
getTypes()
PUBLIC: Gets the types that this topic is an instance of.void
merge(TopicIF topic)
EXPERIMENTAL: Merges the characteristics of one topic into another topic.void
remove()
PUBLIC: Removes the object from its parent.protected void
removeOccurrence(OccurrenceIF _occurrence)
protected void
removeRole(AssociationRoleIF assoc_role)
INTERNAL: Removes the association role from the set of association roles in which the topic participates.void
removeSubjectIdentifier(LocatorIF subject_indicator)
PUBLIC: Removes the given subject identifier from the set of subject identifiers for this topic.void
removeSubjectLocator(LocatorIF subject_locator)
PUBLIC: Removes the given subject locator from the set of subject locators for this topic.protected void
removeTopicName(TopicNameIF _name)
void
removeType(TopicIF type)
PUBLIC: Removes a type from this topic.protected void
setReified(ReifiableIF reified)
protected void
setTopicMap(TopicMap parent)
INTERNAL: Sets the topic map that the object belongs to.String
toString()
-
Methods inherited from class net.ontopia.topicmaps.impl.basic.TMObject
addItemIdentifier, fireEvent, getItemIdentifiers, getObjectId, getTopicMap, isConnected, isReadOnly, removeItemIdentifier
-
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, getObjectId, getTopicMap, isReadOnly, removeItemIdentifier
-
-
-
-
Field Detail
-
reified
protected ReifiableIF reified
-
names
protected Set<TopicNameIF> names
-
occurs
protected Set<OccurrenceIF> occurs
-
roles
protected Set<AssociationRoleIF> roles
-
-
Constructor Detail
-
Topic
protected Topic(TopicMap tm)
-
-
Method Detail
-
setTopicMap
protected void setTopicMap(TopicMap parent)
INTERNAL: Sets the topic map that the object belongs to. [parent]
-
getSubjectLocators
public Collection<LocatorIF> getSubjectLocators()
Description copied from interface:TopicIF
PUBLIC: Gets the subject locators of this topic. These are locators for resources that directly address the subject of this topic. Such a resource is also called an addressable subject. The subject locators are not guaranteed to have any specific order within the returned collection.- Specified by:
getSubjectLocators
in interfaceTopicIF
- Returns:
- A collection of LocatorIF objects serving as subject locators.
-
addSubjectLocator
public void addSubjectLocator(LocatorIF subject_locator) throws ConstraintViolationException
Description copied from interface:TopicIF
PUBLIC: Adds the given subject locator to the set of subject locators for this topic.- Specified by:
addSubjectLocator
in interfaceTopicIF
- Parameters:
subject_locator
- A locator for the subject locator to be added; an object implementing LocatorIF.- Throws:
ConstraintViolationException
- Thrown if the topic map already has a topic with this subject locator.
-
removeSubjectLocator
public void removeSubjectLocator(LocatorIF subject_locator)
Description copied from interface:TopicIF
PUBLIC: Removes the given subject locator from the set of subject locators for this topic. If the topic does not have the given subject locator then this method has no effect.- Specified by:
removeSubjectLocator
in interfaceTopicIF
- Parameters:
subject_locator
- A locator for the subject locator to be removed; an object implementing LocatorIF.
-
getSubjectIdentifiers
public Collection<LocatorIF> getSubjectIdentifiers()
Description copied from interface:TopicIF
PUBLIC: Gets the subject identitifers of this topic. These are locators for resources that indirectly address or otherwise indicate the subject of this topic. A subject identifier is intended as a surrogate for a subject which cannot be addressed directly. The subject identifiers are not guaranteed to have any specific order within the returned collection.- Specified by:
getSubjectIdentifiers
in interfaceTopicIF
- Returns:
- A collection of LocatorIF objects serving as subject identifiers.
-
addSubjectIdentifier
public void addSubjectIdentifier(LocatorIF subject_indicator) throws ConstraintViolationException
Description copied from interface:TopicIF
PUBLIC: Adds the given subject identifier to the set of subject identifiers for this topic.- Specified by:
addSubjectIdentifier
in interfaceTopicIF
- Parameters:
subject_indicator
- A locator for the subject identifier to be added; an object implementing LocatorIF.- Throws:
ConstraintViolationException
- Thrown if the topic map already has a topic with this addressable subject.
-
removeSubjectIdentifier
public void removeSubjectIdentifier(LocatorIF subject_indicator)
Description copied from interface:TopicIF
PUBLIC: Removes the given subject identifier from the set of subject identifiers for this topic. If the topic does not have the given subject identifier then this method has no effect.- Specified by:
removeSubjectIdentifier
in interfaceTopicIF
- Parameters:
subject_indicator
- A locator for the subject identifier to be removed; an object implementing LocatorIF.
-
getTopicNames
public Collection<TopicNameIF> getTopicNames()
Description copied from interface:TopicIF
PUBLIC: Gets the names of this topic.- Specified by:
getTopicNames
in interfaceTopicIF
- Returns:
- A collection of TopicNameIF objects.
-
addTopicName
protected void addTopicName(TopicNameIF _name)
-
removeTopicName
protected void removeTopicName(TopicNameIF _name)
-
getTopicNamesByType
public Collection<TopicNameIF> getTopicNamesByType(TopicIF type)
Description copied from interface:TopicIF
PUBLIC: Gets the topic names of this topic with a specified type.- Specified by:
getTopicNamesByType
in interfaceTopicIF
- Returns:
- A collection of TopicNameIF objects typed by specified type.
-
getOccurrences
public Collection<OccurrenceIF> getOccurrences()
Description copied from interface:TopicIF
PUBLIC: Gets the occurrences of this topic. The occurrences are not guaranteed to have any specific order.- Specified by:
getOccurrences
in interfaceTopicIF
- Returns:
- A collection of OccurrenceIF objects.
-
getOccurrencesByType
public Collection<OccurrenceIF> getOccurrencesByType(TopicIF type)
Description copied from interface:TopicIF
PUBLIC: Gets the occurrences of this topic with a specified type. The occurrences are not guaranteed to have any specific order.- Specified by:
getOccurrencesByType
in interfaceTopicIF
- Returns:
- A collection of OccurrenceIF objects typed by specified type.
-
addOccurrence
protected void addOccurrence(OccurrenceIF _occurrence)
-
removeOccurrence
protected void removeOccurrence(OccurrenceIF _occurrence)
-
getRoles
public Collection<AssociationRoleIF> getRoles()
Description copied from interface:TopicIF
PUBLIC: Gets the association roles played by this topic. There is no guarantee as to the order these are returned in.
-
getRolesByType
public Collection<AssociationRoleIF> getRolesByType(TopicIF roletype)
Description copied from interface:TopicIF
PUBLIC: Gets the association roles of the specifed type played by this topic. There is no guarantee as to the order these are returned in.- Specified by:
getRolesByType
in interfaceTopicIF
- Returns:
- A collection of AssociationRoleIF objects.
-
getRolesByType
public Collection<AssociationRoleIF> getRolesByType(TopicIF roletype, TopicIF assoc_type)
Description copied from interface:TopicIF
PUBLIC: Gets the association roles of the specifed type played by this topic. The association roles must be part of an association of the specified type. There is no guarantee as to the order these are returned in.- Specified by:
getRolesByType
in interfaceTopicIF
- Returns:
- A collection of AssociationRoleIF objects.
-
getAssociations
public Collection<AssociationIF> getAssociations()
Description copied from interface:TopicIF
PUBLIC: Gets the associations that have roles played by this topic. There is no guarantee as to the order these are returned in.- Specified by:
getAssociations
in interfaceTopicIF
- Returns:
- A collection of AssociationIF objects.
-
getAssociationsByType
public Collection<AssociationIF> getAssociationsByType(TopicIF type)
Description copied from interface:TopicIF
PUBLIC: Gets the associations that have roles played by this topic, where the association is of specified type. There is no guarantee as to the order these are returned in.- Specified by:
getAssociationsByType
in interfaceTopicIF
- Returns:
- A collection of AssociationIF objects.
-
merge
public void merge(TopicIF topic)
Description copied from interface:TopicIF
EXPERIMENTAL: Merges the characteristics of one topic into another topic. The source topic stripped of characteristics, all of which are moved to the target topic. Duplicate characteristics are suppressed. The topics must be in the same topic map, and the source topic is removed from the topic map.
-
addRole
protected void addRole(AssociationRoleIF assoc_role)
INTERNAL: Adds the association role to the set of association roles in which the topic participates.
-
removeRole
protected void removeRole(AssociationRoleIF assoc_role)
INTERNAL: Removes the association role from the set of association roles in which the topic participates.
-
remove
public void remove()
Description copied from interface:TMObjectIF
PUBLIC: Removes the object from its parent.- Specified by:
remove
in interfaceTMObjectIF
-
getTypes
public Collection<TopicIF> getTypes()
Description copied from interface:TopicIF
PUBLIC: Gets the types that this topic is an instance of. There is no guarantee as to which order these will be returned in.
-
addType
public void addType(TopicIF type)
Description copied from interface:TopicIF
PUBLIC: Adds a type to this topic.
-
removeType
public void removeType(TopicIF type)
Description copied from interface:TopicIF
PUBLIC: Removes a type from this topic. If the given topic is not present amongst the types, then the method has no effect.- Specified by:
removeType
in interfaceTopicIF
- Parameters:
type
- The type to be removed; an object implementing TopicIF.
-
getReified
public ReifiableIF getReified()
Description copied from interface:TopicIF
PUBLIC: Returns the topic map object that this topic reifies.- Specified by:
getReified
in interfaceTopicIF
-
setReified
protected void setReified(ReifiableIF reified)
-
-