|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Topic
Represents a topic item.
Method Summary | |
---|---|
void |
addItemIdentifier(Locator itemIdentifier)
Adds an item identifier to this topic. |
void |
addSubjectIdentifier(Locator subjectIdentifier)
Adds a subject identifier to this topic. |
void |
addSubjectLocator(Locator subjectLocator)
Adds a subject locator to this topic. |
void |
addType(Topic type)
Adds a type to this topic. |
Name |
createName(java.lang.String value,
java.util.Collection<Topic> scope)
Creates a Name for this topic with the specified value,
and scope. |
Name |
createName(java.lang.String value,
Topic... scope)
Creates a Name for this topic with the specified value,
and scope. |
Name |
createName(Topic type,
java.lang.String value,
java.util.Collection<Topic> scope)
Creates a Name for this topic with the specified type,
value, and scope. |
Name |
createName(Topic type,
java.lang.String value,
Topic... scope)
Creates a Name for this topic with the specified type,
value, and scope. |
Occurrence |
createOccurrence(Topic type,
Locator value,
java.util.Collection<Topic> scope)
Creates an Occurrence for this topic with the specified
type, IRI value, and scope. |
Occurrence |
createOccurrence(Topic type,
Locator value,
Topic... scope)
Creates an Occurrence for this topic with the specified
type, IRI value, and scope. |
Occurrence |
createOccurrence(Topic type,
java.lang.String value,
java.util.Collection<Topic> scope)
Creates an Occurrence for this topic with the specified
type, string value, and scope. |
Occurrence |
createOccurrence(Topic type,
java.lang.String value,
Locator datatype,
java.util.Collection<Topic> scope)
Creates an Occurrence for this topic with the specified
type, value, datatype, and scope. |
Occurrence |
createOccurrence(Topic type,
java.lang.String value,
Locator datatype,
Topic... scope)
Creates an Occurrence for this topic with the specified
type, value, datatype, and scope. |
Occurrence |
createOccurrence(Topic type,
java.lang.String value,
Topic... scope)
Creates an Occurrence for this topic with the specified
type, string value, and scope. |
java.util.Set<Name> |
getNames()
Returns the names of this topic. |
java.util.Set<Name> |
getNames(Topic type)
Returns the Name s of this topic where the name type is
type. |
java.util.Set<Occurrence> |
getOccurrences()
Returns the Occurrence s of this topic. |
java.util.Set<Occurrence> |
getOccurrences(Topic type)
Returns the Occurrence s of this topic where the occurrence type
is type. |
TopicMap |
getParent()
Returns the TopicMap to which this topic belongs. |
Reifiable |
getReified()
Returns the Construct which is reified by this topic. |
java.util.Set<Role> |
getRolesPlayed()
Returns the roles played by this topic. |
java.util.Set<Role> |
getRolesPlayed(Topic type)
Returns the roles played by this topic where the role type is type. |
java.util.Set<Role> |
getRolesPlayed(Topic type,
Topic assocType)
Returns the Role s played by this topic where the role type is
type and the Association type is assocType. |
java.util.Set<Locator> |
getSubjectIdentifiers()
Returns the subject identifiers assigned to this topic. |
java.util.Set<Locator> |
getSubjectLocators()
Returns the subject locators assigned to this topic. |
java.util.Set<Topic> |
getTypes()
Returns the types of which this topic is an instance of. |
void |
mergeIn(Topic other)
Merges another topic into this topic. |
void |
remove()
Removes this topic from the containing TopicMap instance. |
void |
removeSubjectIdentifier(Locator subjectIdentifier)
Removes a subject identifier from this topic. |
void |
removeSubjectLocator(Locator subjectLocator)
Removes a subject locator from this topic. |
void |
removeType(Topic type)
Removes a type from this topic. |
Methods inherited from interface org.tmapi.core.Construct |
---|
equals, getId, getItemIdentifiers, getTopicMap, hashCode, removeItemIdentifier |
Method Detail |
---|
TopicMap getParent()
TopicMap
to which this topic belongs.
getParent
in interface Construct
Construct.getParent()
void addItemIdentifier(Locator itemIdentifier)
If adding the specified item identifier would make this topic
represent the same subject as another topic and the feature
"automerge" (http://tmapi.org/features/automerge) is disabled,
an IdentityConstraintException
is thrown.
addItemIdentifier
in interface Construct
itemIdentifier
- The item identifier to be added; must not be null.Construct.addItemIdentifier(org.tmapi.core.Locator)
java.util.Set<Locator> getSubjectIdentifiers()
Locator
s representing the
subject identifiers.void addSubjectIdentifier(Locator subjectIdentifier) throws IdentityConstraintException, ModelConstraintException
If adding the specified subject identifier would make this topic
represent the same subject as another topic and the feature
"automerge" (http://tmapi.org/features/automerge/) is disabled,
an IdentityConstraintException
is thrown.
subjectIdentifier
- The subject identifier to be added; must not be null.
IdentityConstraintException
- If the feature "automerge" is
disabled and adding the subject identifier would make this
topic represent the same subject as another topic.
ModelConstraintException
- If the subject identifier is null.void removeSubjectIdentifier(Locator subjectIdentifier)
subjectIdentifier
- The subject identifier to be removed from this topic,
if present (null is ignored).java.util.Set<Locator> getSubjectLocators()
Locator
s representing the
subject locators.void addSubjectLocator(Locator subjectLocator) throws IdentityConstraintException, ModelConstraintException
If adding the specified subject locator would make this topic
represent the same subject as another topic and the feature
"automerge" (http://tmapi.org/features/automerge/) is disabled,
an IdentityConstraintException
is thrown.
subjectLocator
- The subject locator to be added; must not be null.
IdentityConstraintException
- If the feature "automerge" is
disabled and adding the subject locator would make this
topic represent the same subject as another topic.
ModelConstraintException
- If the subject locator is null.void removeSubjectLocator(Locator subjectLocator)
subjectLocator
- The subject locator to be removed from this topic,
if present (null is ignored).java.util.Set<Name> getNames()
Name
s belonging to this topic.java.util.Set<Name> getNames(Topic type)
Name
s of this topic where the name type is
type.
This method returns the same result as the following code:
Set<Name> names = new HashSet<Name>(); for (Name name: topic.getNames()) { if (name.getType().equals(type)) { names.add(name); } }The return value may be empty but must never be null.
type
- The type of the Name
s to be returned;
must not be null.
Name
s with the specified
type.
java.lang.IllegalArgumentException
- If the type is null.Name createName(Topic type, java.lang.String value, Topic... scope) throws ModelConstraintException
Name
for this topic with the specified type,
value, and scope.
type
- The name type; MUST NOT be null.value
- The string value of the name; MUST NOT be null.scope
- An optional array of themes, must not be null. If
the array's length is 0, the name will be
in the unconstrained scope.
Name
.
ModelConstraintException
- If either the type, the
value, or scope is null.Name createName(Topic type, java.lang.String value, java.util.Collection<Topic> scope) throws ModelConstraintException
Name
for this topic with the specified type,
value, and scope.
type
- The name type; MUST NOT be null.value
- The string value of the name; MUST NOT be null.scope
- A collection of themes. The collection may be empty if the name
should be in the unconstrained scope.
Name
.
ModelConstraintException
- If either the type, the
value, or scope is null.Name createName(java.lang.String value, Topic... scope) throws ModelConstraintException
Name
for this topic with the specified value,
and scope.
The created Name
will have the default name type
(a Topic
with the subject identifier
http://psi.topicmaps.org/iso13250/model/topic-name).
value
- The string value of the name; MUST NOT be null.scope
- An optional array of themes, must not be null. If
the array's length is 0, the name will be
in the unconstrained scope.
Name
.
ModelConstraintException
- If either the value, or
scope is null.Name createName(java.lang.String value, java.util.Collection<Topic> scope) throws ModelConstraintException
Name
for this topic with the specified value,
and scope.
The created Name
will have the default name type
(a Topic
with the subject identifier
http://psi.topicmaps.org/iso13250/model/topic-name).
value
- The string value of the name; MUST NOT be null.scope
- A collection of themes. The collection may be empty if the name
should be in the unconstrained scope.
Name
.
ModelConstraintException
- If either the value, or
scope is null.java.util.Set<Occurrence> getOccurrences()
Occurrence
s of this topic.
The return value may be empty but must never be null.
Occurrence
s belonging to this topic.java.util.Set<Occurrence> getOccurrences(Topic type)
Occurrence
s of this topic where the occurrence type
is type.
This method returns the same result as the following code:
Set<Occurrence> occs = new HashSet<Occurrence>(); for (Occurrence occ: topic.getOccurrences()) { if (occ.getType().equals(type)) { occs.add(occ); } }The return value may be empty but must never be null.
type
- The type of the Occurrence
s to be returned;
must not be null.
Occurrence
s with the
specified type.
java.lang.IllegalArgumentException
- If the type is null.Occurrence createOccurrence(Topic type, java.lang.String value, Topic... scope) throws ModelConstraintException
Occurrence
for this topic with the specified
type, string value, and scope.
The newly created Occurrence
will have the datatype
xsd:string.
type
- The occurrence type; MUST NOT be null.value
- The string value of the occurrence.scope
- An optional array of themes, must not be null. If
the array's length is 0, the occurrence will be
in the unconstrained scope.
Occurrence
.
ModelConstraintException
- If either the type, the
value, or scope is null.Occurrence createOccurrence(Topic type, java.lang.String value, java.util.Collection<Topic> scope) throws ModelConstraintException
Occurrence
for this topic with the specified
type, string value, and scope.
The newly created Occurrence
will have the datatype
xsd:string.
type
- The occurrence type; MUST NOT be null.value
- The string value of the occurrence.scope
- A collection of themes. The collection may be empty if the occurrence
should be in the unconstrained scope.
Occurrence
.
ModelConstraintException
- If either the type, the
value, or scope is null.Occurrence createOccurrence(Topic type, Locator value, Topic... scope) throws ModelConstraintException
Occurrence
for this topic with the specified
type, IRI value, and scope.
The newly created Occurrence
will have the datatype
xsd:anyURI.
type
- The occurrence type; MUST NOT be null.value
- A locator which represents an IRI.scope
- An optional array of themes, must not be null. If
the array's length is 0, the occurrence will be
in the unconstrained scope.
Occurrence
.
ModelConstraintException
- If either the type, the
value, or scope is null.Occurrence createOccurrence(Topic type, Locator value, java.util.Collection<Topic> scope) throws ModelConstraintException
Occurrence
for this topic with the specified
type, IRI value, and scope.
The newly created Occurrence
will have the datatype
xsd:anyURI.
type
- The occurrence type; MUST NOT be null.value
- A locator which represents an IRI.scope
- A collection of themes. The collection may be empty if the occurrence
should be in the unconstrained scope.
Occurrence
.
ModelConstraintException
- If either the type, the
value, or scope is null.Occurrence createOccurrence(Topic type, java.lang.String value, Locator datatype, Topic... scope) throws ModelConstraintException
Occurrence
for this topic with the specified
type, value, datatype, and scope.
The newly created Occurrence
will have the datatype specified
by datatype.
type
- The occurrence type; MUST NOT be null.value
- A lexical string representation of the value.datatype
- A locator indicating the datatype of the value.scope
- An optional array of themes, must not be null. If
the array's length is 0, the occurrence will be
in the unconstrained scope.
Occurrence
.
ModelConstraintException
- If either the type, the
value, the datatype or scope is
null.Occurrence createOccurrence(Topic type, java.lang.String value, Locator datatype, java.util.Collection<Topic> scope) throws ModelConstraintException
Occurrence
for this topic with the specified
type, value, datatype, and scope.
The newly created Occurrence
will have the datatype specified
by datatype.
type
- The occurrence type; MUST NOT be null.value
- A lexical string representation of the value.datatype
- A locator indicating the datatype of the value.scope
- A collection of themes. The collection may be empty if the occurrence
should be in the unconstrained scope.
Occurrence
.
ModelConstraintException
- If either the type, the
value, the datatype or scope is
null.java.util.Set<Role> getRolesPlayed()
Role
s played by this topic.java.util.Set<Role> getRolesPlayed(Topic type)
This method returns the same result as the following code:
Set<Role> roles = new HashSet<Role>(); for (Role role: topic.getRolesPlayed()) { if (role.getType().equals(type)) { roles.add(role); } }The return value may be empty but must never be null.
type
- The type of the Role
s to be returned; must not
be null.
Role
s with the specified type.
java.lang.IllegalArgumentException
- If the type is null.java.util.Set<Role> getRolesPlayed(Topic type, Topic assocType)
Role
s played by this topic where the role type is
type and the Association
type is assocType.
This method returns the same result as the following code:
Set<Role> roles = new HashSet<Role>(); for (Role role: topic.getRolesPlayed(type)) { if (role.getParent().getType().equals(assocType)) { roles.add(role); } }The return value may be empty but must never be null.
type
- The type of the Role
s to be returned;
must not be null.assocType
- The type of the Association
from which the
returned roles must be part of; must not be null.
Role
s with the specified type
which are part of Association
s with the specified
assocType.
java.lang.IllegalArgumentException
- If the type or assocType
is null.java.util.Set<Topic> getTypes()
This method may return only those types which where added by
addType(Topic)
and may ignore
type-instance
relationships which are modelled as association.
Topic
s.void addType(Topic type) throws ModelConstraintException
Implementations may or may not create an association for types added
by this method. In any case, every type which was added by this method
must be returned by the getTypes()
method.
type
- The type of which this topic should become an instance of;
must not be null.
ModelConstraintException
- If the type is null.void removeType(Topic type)
type
- The type to be removed from this topic, if present
(null is ignored).Reifiable getReified()
Construct
which is reified by this topic.
Reifiable
that is reified by this topic or
null if this topic does not reify a statement.void mergeIn(Topic other) throws ModelConstraintException
Merging a topic into this topic causes this topic to gain all
of the characteristics of the other topic and to replace the other
topic wherever it is used as type, theme, or reifier.
After this method completes, other will have been removed from
the TopicMap
.
If this.equals(other) no changes are made to the topic.
NOTE: The other topic MUST belong to the same TopicMap
instance
as this topic!
other
- The topic to be merged into this topic; must not be null.
ModelConstraintException
- If other is null.void remove() throws TopicInUseException
TopicMap
instance.
This method throws a TopicInUseException
if the topic plays
a Role
, is used as type of a Typed
construct, or if
it is used as theme for a Scoped
construct, or if it reifies a
Reifiable
.
remove
in interface Construct
TopicInUseException
- If the topic plays a Role
or it
is used as type, in a scope, or as reifier.Construct.remove()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |