|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This interface describes a topic in a Topic Map. The Topic is perhaps the single most important construct among all those that may occur in a Topic Map. From XTM 1.0:
“A topic is a resource that acts as a proxy for some subject; it is the topic map system's representation of that subject. The relationship between a topic and its subject is defined to be one of reification. Reification of a subject allows topic characteristics to be assigned to the topic that reifies it.”[...]
“A subject is anything that can be spoken about or conceived of by a human being. In the most generic sense, a subject is anything whatsoever, regardless of whether it exists or has any other specific characteristics, about which anything whatsoever may be asserted by any means whatsoever. In particular, it is anything on which the author of a topic map chooses to discourse.”The characteristics that topics are usually assigned include
BaseNames
and Occurrences, both of which may be constrained by a scope, which is defined
by a set of Topics.
Topics may be typed, and effectively support mechanisms equivalent to multiple
inheritance by allowing more than one typing topic.
Topics may also be subject to merging under certain circumstances, that is, two or more
topics which share particular traits effectively become one whose
characteristics are the sum of the original topics'. This interface provides
a number of methods which deal with results of merging, and which provide access
to the topics that, at some point during processing, merged with the current
topic.
| Method Summary | |
void |
addMergedTopic(Topic t)
Adds the specified topic to the set of merged topics. |
void |
addName(BaseName name)
Adds another name to the set of names of this Topic. |
void |
addOccurrence(Occurrence occurs)
Adds an occurrence to this Topic. |
void |
addSubjectIndicator(Locator subjectIndicator)
Adds a subject indicator to this topic. |
void |
addType(Topic type)
Adds a new topic into the set of those defining the type of this topic. |
BaseName |
createName(java.lang.String id)
Creates a new BaseName as a child of this Topic. |
BaseName |
createName(java.lang.String id,
java.lang.String nameString)
Creates a new BaseName as a child of this Topic |
BaseName |
createName(java.lang.String id,
java.lang.String nameString,
Topic[] scope)
Creates a new BaseName as a child of this Topic |
Occurrence |
createOccurrence(java.lang.String id)
Creates a new Occurrence as a child of this Topic. |
Occurrence |
createOccurrence(java.lang.String id,
Locator resourceLocator,
Topic type,
Locator ref,
Topic[] themes)
|
Occurrence |
createOccurrence(java.lang.String id,
Locator resourceLocator,
Topic type,
java.lang.String data,
Topic[] themes)
|
Topic |
getBaseTopic()
Gets the topic with which this topic is merged if any. |
java.util.Collection |
getMergedTopics()
Returns a collection of all of the other topics which were merged with this topic due to identity matches or topic map naming constraints. |
java.util.Collection |
getNames()
Retrieves a collection of the base names of this topic and any merged topics. |
java.util.Collection |
getNames(boolean includeMergedTopics)
Retrieves the collection of the base names of this topic and, if so specified, of any merged topics. |
java.util.Collection |
getOccurrences()
Returns the occurrences for this topic and any merged topics. |
java.util.Collection |
getOccurrences(boolean includeMergedTopics)
Returns the occurrences for this topic and, if so specified, of any merged topics. |
TopicMap |
getParent()
Returns the TopicMap object which contains this Topic object. |
java.util.Collection |
getRolesPlayed()
Gets the Member objects which define roles played by this topic in associations. |
java.util.Collection |
getRolesPlayed(boolean includeMergedTopics)
Gets the Member objects which define roles played by this topic in associations. |
java.util.Collection |
getScopedNames()
Generates a list of all names of the topic and all merged topics, qualified by the scope of the names and of the topic itself. |
java.util.Collection |
getScopedNames(boolean includeMergedTopics)
Generates a list of all names of the topic, qualified by the scope of the names and of the topic itself. |
Locator |
getSubject()
Retrieves the reference to the resource which is the subject of this topic. |
Locator |
getSubject(boolean includeMergedTopics)
Retrieves the reference to the resource which is the subject of this topic. |
java.util.Collection |
getSubjectIndicators()
Returns the subject indicators for this topic and all merged topics. |
java.util.Collection |
getSubjectIndicators(boolean includeMergedTopics)
Returns the subject indicators for this topic and, optionally, for all merged topics. |
java.util.Collection |
getTypes()
Returns the Topics defining the type of this topic and all merged topics. |
java.util.Collection |
getTypes(boolean includeMergedTopics)
Returns the Topics defining the type of this topic and, optionally, of all merged topics. |
boolean |
isOfType(Locator subjectOrIndicator)
Determines whether this topic is typed by a topic whose subject is or whose subject is indicated by subjectOrIndicator. |
boolean |
isOfType(Topic type)
Determines whether the specified topic is one of the types of this topic. |
void |
setNames(BaseName[] names)
Sets the names of this Topic. |
void |
setOccurrences(Occurrence[] occurs)
Sets the list of occurrences for this Topic. |
void |
setSubject(Locator subject)
Sets the reference to the subject of this topic. |
void |
setSubjectIndicators(Locator[] indicators)
Sets the collection of subject indicators for this topic. |
void |
setTypes(Topic[] types)
Defines the type of this topic. |
| Method Detail |
public Locator getSubject()
Locator, or null if no resource
represents the subject which this topic reifies.public Locator getSubject(boolean includeMergedTopics)
includeMergedTopics - if true, then the subject defined by any one of the topics merged with this topic will be returned,
otherwise a value will only be returned if it was specified on this Topic instance.
null if there is no subject
locator.
public void setSubject(Locator subject)
throws java.beans.PropertyVetoException
subject - The locator of the resource that is the subject which this topic reifies.
java.beans.PropertyVetoExceptionpublic java.util.Collection getSubjectIndicators()
getSubjectIndicators(true).
Locators representing
the subject indicators for this topic.
If no subject indicators are currently defined on this
topic (or merged topics), the returned collection is empty;
it is never null.public java.util.Collection getSubjectIndicators(boolean includeMergedTopics)
includeMergedTopics - if true, then the subject indicators of all
merged topics are included in the returned collection,
otherwise only the subject indicators of this topic are returned.
Locators representing
the subject indicators for this topic.
If no subject indicators are currently defined on this
topic (or merged topics), the returned collection is empty;
it is never null.
public void addSubjectIndicator(Locator subjectIndicator)
throws java.beans.PropertyVetoException
subjectIndicator - the subject indicator reference to be added.
java.beans.PropertyVetoException
public void setSubjectIndicators(Locator[] indicators)
throws java.beans.PropertyVetoException
indicators - the subject indicator references,
as an array of Locators.
java.beans.PropertyVetoExceptionpublic java.util.Collection getTypes()
getTypes(true).
Topics defining the type
of this topic and all merged topics.
If no types are currently defined on this
topic (or merged topics), the returned collection is empty;
it is never null.public java.util.Collection getTypes(boolean includeMergedTopics)
includeMergedTopics - If true then the types of all merged
topics are included in the returned collection,
otherwise, only the typing topics
defined on this topic are returned.
Topics defining the type
of this topic and, if includeMergedTopics is set
to true, of all merged topics.
If no subject indicators are currently defined on this
topic (or merged topics), the returned collection is empty;
it is never null.
public void setTypes(Topic[] types)
throws java.beans.PropertyVetoException
types - the new set of topics to define the type of
this topic. If this is null,
all the existing typing topics of this topic
are removed.
java.beans.PropertyVetoException
public void addType(Topic type)
throws java.beans.PropertyVetoException
type - The typing topic to be added.
java.beans.PropertyVetoExceptionpublic boolean isOfType(Topic type)
type - the topic to be compared to this topic's typing topics.
true if type is among the topics
defining this topic's type, false otherwise.public boolean isOfType(Locator subjectOrIndicator)
subjectOrIndicator.
This method will return true if one of the following conditions hold:
true if subjectOrIndicator
meets the above conditions, false otherwise.public java.util.Collection getNames()
getNames(true).
BaseNames defined
on this topic and any merged topics.
If no base names are currently defined on this
topic (or merged topics), the returned collection is empty;
it is never null.public java.util.Collection getNames(boolean includeMergedTopics)
includeMergedTopics - If true, the names of
all merged topics are included in the returned collection.
Otherwise, the collection contains only the names defined
specifically on this topic.
BaseNames defined
on this topic and, optionally, any merged topics.
If no base names are currently defined on this
topic (or merged topics), the returned collection is empty;
it is never null.
public void setNames(BaseName[] names)
throws java.beans.PropertyVetoException
names - the new set of names to be assigned to
this topic. If this is null,
all the existing names of this topic
are removed.
java.beans.PropertyVetoException
public void addName(BaseName name)
throws java.beans.PropertyVetoException
name - the name to be added.
java.beans.PropertyVetoException
public BaseName createName(java.lang.String id)
throws DuplicateObjectIDException,
java.beans.PropertyVetoException
id - the unique object id to be assigned to the new BaseName object. If
this parameter is null, the back-end will assign an ID to the
newly created object.
DuplicateObjectIDException - if id specifies and identifier
value already used in the containing TopicMap.
java.beans.PropertyVetoException - if to create a new name for this Topic would
violate a constraint imposed by a VetoableChangeListener assigned to
this TopicMap.
public BaseName createName(java.lang.String id,
java.lang.String nameString)
throws DuplicateObjectIDException,
java.beans.PropertyVetoException
id - the unique object id to be assigned to the new BaseName object. If
this parameter is null, the back-end will assign an ID to the newly created
object.nameString - the string to be assigned to the new BaseName as content.
DuplicateObjectIDException - if id specifies and identifier
value already used in the containing TopicMap.
java.beans.PropertyVetoException - if to create a new name for this Topic would
violate a constraint imposed by a VetoableChangeListener assigned to
this TopicMap.
public BaseName createName(java.lang.String id,
java.lang.String nameString,
Topic[] scope)
throws DuplicateObjectIDException,
java.beans.PropertyVetoException
id - the unique object id to be assigned to the new BaseName object. If
this parameter is null, the back-end will assign an ID to the newly created
object.nameString - the string to be assigned to the new BaseName as content.scope - the topics to be assigned to the scope of the new BaseName.
DuplicateObjectIDException - if id specifies and identifier
value already used in the containing TopicMap.
java.beans.PropertyVetoException - if to create a new name for this Topic would
violate a constraint imposed by a VetoableChangeListener assigned to
this TopicMap.public java.util.Collection getOccurrences()
getOccurrences(true).
Occurrences for this
topic and for any merged topics.
The returned collection is a copy of the internal set
of occurrences of the topic — modifying the
collection has no effect on the occurrence set of the Topic.
If no occurrences are currently defined on this
topic (or merged topics), the returned collection is empty;
it is never null.public java.util.Collection getOccurrences(boolean includeMergedTopics)
includeMergedTopics - if true, then the occurrences of all
merged topics are included in the returned collection.
Otherwise, the collection contains only the occurrences defined
specifically for this topic.
Occurrences for this
topic and for any merged topics.
The returned collection is a copy of the internal set
of occurrences of the topic — modifying the
collection has no effect on the occurrence set of the Topic.
If no occurrences are currently defined on this
topic (or merged topics), the returned collection is empty;
it is never null.
public void setOccurrences(Occurrence[] occurs)
throws java.beans.PropertyVetoException
occurs - the new set of occurrences to be associated with
this topic. If this is null,
all the existing occurrences of this topic
are removed.
java.beans.PropertyVetoException
public void addOccurrence(Occurrence occurs)
throws java.beans.PropertyVetoException
occurs - The Occurrence to be added.
java.beans.PropertyVetoException
public Occurrence createOccurrence(java.lang.String id)
throws DuplicateObjectIDException,
java.beans.PropertyVetoException
id - the unique object id to be assigned to the new Occurrence object. If
this parameter is null, the back-end will assign an ID to the
newly created object.
DuplicateObjectIDException - if id specifies and identifier
value already used in the containing TopicMap.
java.beans.PropertyVetoException - if to create a new Occurrence for this Topic would
violate a constraint imposed by a VetoableChangeListener assigned to
this TopicMap.
public Occurrence createOccurrence(java.lang.String id,
Locator resourceLocator,
Topic type,
Locator ref,
Topic[] themes)
throws DuplicateObjectIDException,
DuplicateResourceLocatorException,
java.beans.PropertyVetoException
DuplicateObjectIDException
DuplicateResourceLocatorException
java.beans.PropertyVetoException
public Occurrence createOccurrence(java.lang.String id,
Locator resourceLocator,
Topic type,
java.lang.String data,
Topic[] themes)
throws DuplicateObjectIDException,
DuplicateResourceLocatorException,
java.beans.PropertyVetoException
DuplicateObjectIDException
DuplicateResourceLocatorException
java.beans.PropertyVetoExceptionpublic java.util.Collection getRolesPlayed()
Member objects representing roles played by this Topic in Associations.public java.util.Collection getRolesPlayed(boolean includeMergedTopics)
includeMergedTopics - If true then the roles played by all merged topics are included in the returned collection.
public void addMergedTopic(Topic t)
throws MergedTopicSubjectClashException
t - the topic to be added to the merge set.
MergedTopicSubjectClashExceptionpublic java.util.Collection getMergedTopics()
Topics
that were topic merged with this topic.
If no topics were merged with this
topic, the returned collection is empty;
it is never null.public Topic getBaseTopic()
null
if the topic has not merged with any other.public java.util.Collection getScopedNames(boolean includeMergedTopics)
<sorted-scope-list>.<name-string>Where <sorted-scope-list> is a list of all themes SGML identifiers sorted in ascending alphabetical order, with a period separator between each identifier.
includeMergedTopics - If true, the scoped names of all
topics merged with this topic are returned. Otherwise,
only the scoped names of this topic are returned.
null.public java.util.Collection getScopedNames()
getScopedNames(true).
Each qualified name is generated as follows:<sorted-scope-list>.<name-string>Where <sorted-scope-list> is a list of all themes SGML identifiers sorted in ascending alphabetical order, with a period separator between each identifier.
null.public TopicMap getParent()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||