net.ontopia.topicmaps.impl.utils
Class SnapshotTopic

java.lang.Object
  extended by net.ontopia.topicmaps.impl.utils.SnapshotTMObject
      extended by net.ontopia.topicmaps.impl.utils.SnapshotTopic
All Implemented Interfaces:
TMObjectIF, TopicIF

public class SnapshotTopic
extends SnapshotTMObject
implements TopicIF

INTERNAL:


Field Summary
protected  java.util.Collection<TopicNameIF> basenames
           
protected  java.util.Collection<OccurrenceIF> occurrences
           
protected  ReifiableIF reified
           
protected  java.util.Collection<LocatorIF> subinds
           
protected  java.util.Collection<LocatorIF> sublocs
           
protected  java.util.Collection<TopicIF> types
           
 
Fields inherited from class net.ontopia.topicmaps.impl.utils.SnapshotTMObject
objectId, SNAPSHOT_COMPLETE, SNAPSHOT_REFERENCE, snapshotType, srclocs
 
Method Summary
 void addSubjectIdentifier(LocatorIF locator)
          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.
 void addType(TopicIF type)
          PUBLIC: Adds a type to this topic.
 java.util.Collection<OccurrenceIF> getOccurrences()
          PUBLIC: Gets the occurrences of this topic.
 ReifiableIF getReified()
          PUBLIC: Returns the topic map object that this topic reifies.
 java.util.Collection<AssociationRoleIF> getRoles()
          PUBLIC: Gets the association roles played by this topic.
 java.util.Collection<AssociationRoleIF> getRolesByType(TopicIF rtype)
          PUBLIC: Gets the association roles of the specifed type played by this topic.
 java.util.Collection<AssociationRoleIF> getRolesByType(TopicIF rtype, TopicIF atype)
          PUBLIC: Gets the association roles of the specifed type played by this topic.
 java.util.Collection<LocatorIF> getSubjectIdentifiers()
          PUBLIC: Gets the subject identitifers of this topic.
 java.util.Collection<LocatorIF> getSubjectLocators()
          PUBLIC: Gets the subject locators of this topic.
 java.util.Collection<TopicNameIF> getTopicNames()
          PUBLIC: Gets the names of this topic.
 java.util.Collection<TopicIF> getTypes()
          PUBLIC: Gets the types that this topic is an instance of.
static TopicIF makeSnapshot(TopicIF original, int snapshotType, java.util.Map<TMObjectIF,SnapshotTMObject> processed)
           
 void merge(TopicIF topic)
          EXPERIMENTAL: Merges the characteristics of one topic into another topic.
 void removeSubjectIdentifier(LocatorIF loc)
          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.
 void removeType(TopicIF type)
          PUBLIC: Removes a type from this topic.
 java.lang.String toString()
           
 
Methods inherited from class net.ontopia.topicmaps.impl.utils.SnapshotTMObject
addItemIdentifier, getItemIdentifiers, getObjectId, getTopicMap, isReadOnly, remove, 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, remove, removeItemIdentifier
 

Field Detail

reified

protected ReifiableIF reified

sublocs

protected java.util.Collection<LocatorIF> sublocs

subinds

protected java.util.Collection<LocatorIF> subinds

basenames

protected java.util.Collection<TopicNameIF> basenames

occurrences

protected java.util.Collection<OccurrenceIF> occurrences

types

protected java.util.Collection<TopicIF> types
Method Detail

makeSnapshot

public static TopicIF makeSnapshot(TopicIF original,
                                   int snapshotType,
                                   java.util.Map<TMObjectIF,SnapshotTMObject> processed)

getSubjectLocators

public java.util.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 interface TopicIF
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 interface TopicIF
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 interface TopicIF
Parameters:
subject_locator - A locator for the subject locator to be removed; an object implementing LocatorIF.

getSubjectIdentifiers

public java.util.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 interface TopicIF
Returns:
A collection of LocatorIF objects serving as subject identifiers.

addSubjectIdentifier

public void addSubjectIdentifier(LocatorIF locator)
                          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 interface TopicIF
Parameters:
locator - 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 loc)
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 interface TopicIF
Parameters:
loc - A locator for the subject identifier to be removed; an object implementing LocatorIF.

getTypes

public java.util.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.

Specified by:
getTypes in interface TopicIF
Returns:
A collection of TopicIF objects.

addType

public void addType(TopicIF type)
Description copied from interface: TopicIF
PUBLIC: Adds a type to this topic.

Specified by:
addType in interface TopicIF
Parameters:
type - The additional type; an object implementing TopicIF.

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 interface TopicIF
Parameters:
type - The type to be removed; an object implementing TopicIF.

getTopicNames

public java.util.Collection<TopicNameIF> getTopicNames()
Description copied from interface: TopicIF
PUBLIC: Gets the names of this topic.

Specified by:
getTopicNames in interface TopicIF
Returns:
A collection of TopicNameIF objects.

getOccurrences

public java.util.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 interface TopicIF
Returns:
A collection of OccurrenceIF objects.

getRoles

public java.util.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.

Specified by:
getRoles in interface TopicIF
Returns:
A collection of AssociationRoleIF objects.

getRolesByType

public java.util.Collection<AssociationRoleIF> getRolesByType(TopicIF rtype)
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 interface TopicIF
Returns:
A collection of AssociationRoleIF objects.

getRolesByType

public java.util.Collection<AssociationRoleIF> getRolesByType(TopicIF rtype,
                                                              TopicIF atype)
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 interface TopicIF
Returns:
A collection of AssociationRoleIF 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.

Specified by:
merge in interface TopicIF
Parameters:
topic - topicIF; the source topic. This is empty after the operation and is removed from the topic map.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getReified

public ReifiableIF getReified()
Description copied from interface: TopicIF
PUBLIC: Returns the topic map object that this topic reifies.

Specified by:
getReified in interface TopicIF


Copyright © 2000-2012 Ontopia.