|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents the topic map topic construct.
Method Summary | |
void |
addSourceLocator(Locator sourceLocator)
Adds a Locator to the set of source locators for this Topic. |
void |
addSubjectIdentifier(Locator subjectIdentifier)
Adds the specified locator to the set of locators that reference the subject-indicating resources of this topic. |
void |
addSubjectLocator(Locator subjectLocator)
Adds the specified locator to the set of locators that reference the subject-constituting resources of this topic. |
void |
addType(Topic type)
Adds a type to this topic. |
Occurrence |
createOccurrence(Locator resource,
Topic type,
java.util.Collection scope)
Creates a new occurrence as a contained object in this topic. |
Occurrence |
createOccurrence(java.lang.String value,
Topic type,
java.util.Collection scope)
Creates a new occurrence as a contained object in this topic. |
TopicName |
createTopicName(java.lang.String value,
java.util.Collection scope)
Creates a new TopicName for this topic. |
TopicName |
createTopicName(java.lang.String value,
Topic type,
java.util.Collection scope)
OPTIONAL: Creates a new typed TopicName for this topic. |
java.util.Set |
getOccurrences()
Returns the occurrences defined for this topic. |
java.util.Set |
getReified()
Returns a Set of TopicMapObject instances that are subject of this Topic. |
java.util.Set |
getRolesPlayed()
Returns the association roles in which this topic is a player. |
java.util.Set |
getSubjectIdentifiers()
Returns the Locators which reference the subject-indicating resources of this topic. |
java.util.Set |
getSubjectLocators()
Returns Locator instances which reference the subject-constituting resources of this topic. |
java.util.Set |
getTopicNames()
Returns the TopicNames defined for this topic. |
java.util.Set |
getTypes()
Returns the topics which define the types of this topic. |
void |
mergeIn(Topic other)
Merges another Topic into this Topic. |
void |
remove()
Removes this object from the collection of Topics managed by the parent TopicMap. |
void |
removeSubjectIdentifier(Locator subjectIdentifier)
Removes the specified locator from the set of locators that reference the subject-indicating resources of this topic. |
void |
removeSubjectLocator(Locator subjectLocator)
Removes the specified locator from the set of locators that reference the subject-constituting resources of this topic. |
void |
removeType(Topic type)
Removes a type from this topic. |
Methods inherited from interface org.tmapi.core.TopicMapObject |
equals, getObjectId, getSourceLocators, getTopicMap, hashCode, removeSourceLocator |
Method Detail |
public java.util.Set getTopicNames()
null
.
public TopicName createTopicName(java.lang.String value, java.util.Collection scope) throws MergeException
value
- The string value of the TopicName.
Pass null
to create a TopicName with no name value.scope
- A Collection of Topic objects.
If null
, the TopicName will be in the unconstrained scope.
MergeException
- if the processor detects that a merge is required
and either automerge is disabled or automerge is enabled but the merge
cannot be completed for some other reason. NOTE:
This method will not raise this exception if the XTM 1.1 model is
enabled, as untyped names do not cause merging under XTM 1.1.public TopicName createTopicName(java.lang.String value, Topic type, java.util.Collection scope) throws java.lang.UnsupportedOperationException, MergeException
value
- The string value of the TopicName.
Pass null
to create a TopicName with no name value.type
- A Topic instance or null
scope
- A Collection of Topic objects.
If null
, the TopicName will be in the unconstrained scope.
java.lang.UnsupportedOperationException
- if the processor
does not support the XTM 1.1 model.
MergeException
- if the processor detects that a merge is required
and either automerge is disabled or automerge is enabled but the merge
cannot be completed for some other reason.public Occurrence createOccurrence(java.lang.String value, Topic type, java.util.Collection scope)
value
- The occurrence data.type
- The occurrence type. If null
, then the occurrence will be untyped.scope
- A Collection of Topic objects.
If null
, the occurrence will be in the unconstrained scope.
public Occurrence createOccurrence(Locator resource, Topic type, java.util.Collection scope)
resource
- The occurrence resource locator.type
- The occurrence type. If null
, then the occurrence will be untyped.scope
- A Collection of Topic objects.
If null
, the occurrence will be in the unconstrained scope.
public java.util.Set getOccurrences()
null
.
public java.util.Set getSubjectLocators()
null
.
public void addSubjectLocator(Locator subjectLocator) throws MergeException, ModelConstraintException
subjectLocator
- The locator of the new subject
constituting resource for this topic.
MergeException
- if the processor detects that a merge is required
and either automerge is disabled or automerge is enabled but the merge
cannot be completed for some other reason.
ModelConstraintException
- if the XTM 1.0 processor model is
enabled and this Topic already has one Locator in the
subjectLocator set.public void removeSubjectLocator(Locator subjectLocator)
subjectLocator
- the Locator to be removed from the set of
subject-constituting resources for this topic.public java.util.Set getSubjectIdentifiers()
null
.
public void addSubjectIdentifier(Locator subjectIdentifier) throws MergeException
subjectIdentifier
- The locator to be added.
MergeException
- if the processor detects that a merge is required
and either automerge is disabled or automerge is enabled but the merge
cannot be completed for some other reason.public void removeSubjectIdentifier(Locator subjectIdentifier)
subjectIdentifier
- The locator to be removed.public java.util.Set getTypes()
null
.
public void addType(Topic type)
type
- The type-defining topic to be added.public void removeType(Topic type)
type
- The type-defining topic to be removed.public java.util.Set getRolesPlayed()
null
.
public void remove() throws TopicInUseException
remove
in interface TopicMapObject
TopicInUseException
- If this Topic is currently used as a type
of another topic, occurrence, or association;
or if this topic is as association role type; a member of a scope;
or a role player in an association.public void mergeIn(Topic other) throws MergeException
other
will have been removed from the TopicMap.
NOTE: The other
Topic
MUST belong to the same TopicMap instance as this Topic!
other
- the other Topic to be merged into this Topic
SubjectLocatorClashException
- if this topic and
other
have different, non-null values for
the subjectLocator property and the XTM 1.0 processing model
is enabled.
MergeException
public java.util.Set getReified()
null
.
public void addSourceLocator(Locator sourceLocator) throws DuplicateSourceLocatorException, MergeException
addSourceLocator
in interface TopicMapObject
sourceLocator
- the Locator to be added
DuplicateSourceLocatorException
- if there is already a
TopicMapObject that is not a Topic with this source Locator.
MergeException
- if another Topic with this source
locator alreday exists in the same TopicMap, and either the
feature http://tmapi.org/features/automerge
is disabled or the merge cannot be completed for some reason.TopicMapObject.getSourceLocators()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |