|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TopicMap
Represents a topic map item.
Method Summary | ||
---|---|---|
void |
close()
Closes use of this topic map instance. |
|
Association |
createAssociation(Topic type,
java.util.Collection<Topic> scope)
Creates an Association in this topic map with the specified
type and scope. |
|
Association |
createAssociation(Topic type,
Topic... scope)
Creates an Association in this topic map with the specified
type and scope. |
|
Locator |
createLocator(java.lang.String reference)
Returns a Locator instance representing the specified IRI
reference. |
|
Topic |
createTopic()
Returns a Topic instance with an automatically generated item
identifier. |
|
Topic |
createTopicByItemIdentifier(Locator itemIdentifier)
Returns a Topic instance with the specified item identifier. |
|
Topic |
createTopicBySubjectIdentifier(Locator subjectIdentifier)
Returns a Topic instance with the specified subject identifier. |
|
Topic |
createTopicBySubjectLocator(Locator subjectLocator)
Returns a Topic instance with the specified subject locator. |
|
java.util.Set<Association> |
getAssociations()
Returns all Association s contained in this topic map. |
|
Construct |
getConstructById(java.lang.String id)
Returns a Construct by its (system specific) identifier. |
|
Construct |
getConstructByItemIdentifier(Locator itemIdentifier)
Returns a Construct by its item identifier. |
|
|
getIndex(java.lang.Class<I> indexInterface)
Returns the specified index. |
|
Locator |
getLocator()
Returns the Locator that was used to create the topic map. |
|
Construct |
getParent()
Returns null. |
|
Topic |
getTopicBySubjectIdentifier(Locator subjectIdentifier)
Returns a topic by its subject identifier. |
|
Topic |
getTopicBySubjectLocator(Locator subjectLocator)
Returns a topic by its subject locator. |
|
java.util.Set<Topic> |
getTopics()
Returns all Topic s contained in this topic map. |
|
void |
mergeIn(TopicMap other)
Merges the topic map other into this topic map. |
Methods inherited from interface org.tmapi.core.Reifiable |
---|
getReifier, setReifier |
Methods inherited from interface org.tmapi.core.Construct |
---|
addItemIdentifier, equals, getId, getItemIdentifiers, getTopicMap, hashCode, remove, removeItemIdentifier |
Method Detail |
---|
Construct getParent()
getParent
in interface Construct
java.util.Set<Topic> getTopics()
Topic
s contained in this topic map.
The return value may be empty but must never be null.
Topic
s.Locator getLocator()
Locator
that was used to create the topic map.
Note: The returned locator represents the storage address of the topic map and implies no further semantics.
Locator
, never null
.TopicMapSystem.createTopicMap(org.tmapi.core.Locator)
,
TopicMapSystem.getTopicMap(org.tmapi.core.Locator)
java.util.Set<Association> getAssociations()
Association
s contained in this topic map.
The return value may be empty but must never be null.
Association
s.Topic getTopicBySubjectIdentifier(Locator subjectIdentifier)
If no topic with the specified subject identifier exists, this method returns null.
subjectIdentifier
- The subject identifier of the topic to be returned.
Topic getTopicBySubjectLocator(Locator subjectLocator)
If no topic with the specified subject locator exists, this method returns null.
subjectLocator
- The subject locator of the topic to be returned.
Construct getConstructByItemIdentifier(Locator itemIdentifier)
Construct
by its item identifier.
itemIdentifier
- The item identifier of the construct to be returned.
Construct getConstructById(java.lang.String id)
Construct
by its (system specific) identifier.
id
- The identifier of the construct to be returned.
Locator createLocator(java.lang.String reference) throws MalformedIRIException
Locator
instance representing the specified IRI
reference.
The specified IRI reference is assumed to be absolute.
reference
- A string which uses the IRI notation.
Locator
representing the IRI reference.
java.lang.IllegalArgumentException
- If reference is null.
MalformedIRIException
- If the provided string cannot be used to create a valid locator.Topic createTopicBySubjectIdentifier(Locator subjectIdentifier) throws ModelConstraintException
Topic
instance with the specified subject identifier.
This method returns either an existing Topic
or creates a new
Topic
instance with the specified subject identifier.
If a topic with the specified subject identifier exists in the topic map, that topic is returned. If a topic with an item identifier equals to the specified subject identifier exists, the specified subject identifier is added to that topic and the topic is returned. If neither a topic with the specified subject identifier nor with an item identifier equals to the subject identifier exists, a topic with the subject identifier is created.
subjectIdentifier
- The subject identifier the topic should contain.
Topic
instance with the specified subject identifier.
ModelConstraintException
- If the subject identifier subjectIdentifier is null.Topic createTopicBySubjectLocator(Locator subjectLocator) throws ModelConstraintException
Topic
instance with the specified subject locator.
This method returns either an existing Topic
or creates a new
Topic
instance with the specified subject locator.
subjectLocator
- The subject locator the topic should contain.
Topic
instance with the specified subject locator.
ModelConstraintException
- If the subject locator subjectLocator is null.Topic createTopicByItemIdentifier(Locator itemIdentifier) throws IdentityConstraintException, ModelConstraintException
Topic
instance with the specified item identifier.
This method returns either an existing Topic
or creates a new
Topic
instance with the specified item identifier.
If a topic with the specified item identifier exists in the topic map, that topic is returned. If a topic with a subject identifier equals to the specified item identifier exists, the specified item identifier is added to that topic and the topic is returned. If neither a topic with the specified item identifier nor with a subject identifier equals to the subject identifier exists, a topic with the item identifier is created.
itemIdentifier
- The item identifier the topic should contain.
Topic
instance with the specified item identifier.
ModelConstraintException
- If the item identifier itemIdentifier is null.
IdentityConstraintException
- If an other Construct
with the
specified item identifier exists which is not a Topic
.Topic createTopic()
Topic
instance with an automatically generated item
identifier.
This method returns never an existing Topic
but creates a
new one with an automatically generated item identifier.
How that item identifier is generated depends on the implementation.
Topic
instance with an automatically
generated item identifier.Association createAssociation(Topic type, Topic... scope) throws ModelConstraintException
Association
in this topic map with the specified
type and scope.
type
- The association type, MUST NOT be null.scope
- An optional array of themes, must not be null. If
the array's length is 0, the association will be
in the unconstrained scope.
Association
.
ModelConstraintException
- If either the type or
scope is null.Association createAssociation(Topic type, java.util.Collection<Topic> scope) throws ModelConstraintException
Association
in this topic map with the specified
type and scope.
type
- The association type, MUST NOT be null.scope
- A collection of themes or null if the association
should be in the unconstrained scope.
Association
.
ModelConstraintException
- If either the type or
scope is null.void close()
This method should be invoked by the application once it is finished using this topic map instance.
Implementations may release any resources required for the
TopicMap instance or any of the Construct
instances
contained by this instance.
void mergeIn(TopicMap other) throws ModelConstraintException
All Topic
s and Association
s and all of their contents in
other will be added to this topic map.
All information items in other will be merged into this topic map as defined by the Topic Maps - Data Model (TMDM) merging rules.
The merge process will not modify other in any way.
If this.equals(other) no changes are made to the topic map.
other
- The topic map to be merged with this topic map instance;
must not be null.
ModelConstraintException
- If other is null.<I extends Index> I getIndex(java.lang.Class<I> indexInterface)
indexInterface
- The index to return.
java.lang.UnsupportedOperationException
- If the implementation does not
support indices or if the specified index is unsupported.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |