|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.tm4j.topicmap.unified.UnifiedTopicMap
Implements a unified topic navigation structure over multiple seperate TopicMap objects. The current implementation allows seamless access to all topics using the standard TopicMap interface. In addition, topics from different topic maps which should be merged by their subject or subject indicators are represented as a single structure using the UnifiedTopic class.
UnifiedTopic
Constructor Summary | |
UnifiedTopicMap(Locator baseLocator)
|
|
UnifiedTopicMap(Locator baseLocator,
boolean notifyEvents)
|
Method Summary | |
void |
addAddedTheme(Topic theme)
Adds an added theme to the topic map. |
void |
addExternalRef(Locator ref)
Adds an external reference from this topic map to another topic map. |
void |
addMergeMap(Locator ref,
Topic[] addThemes)
Adds a new mergeMap directive to this topic map. |
void |
addMultiValuePropertyChangeListener(MultiValuePropertyChangeListener l)
Adds a MultiValue Property Change Listener. |
void |
addMultiValuePropertyChangeListener(java.lang.String propName,
MultiValuePropertyChangeListener l)
Adds a MultiValue Property Change Listener. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a Property Change Listener. |
void |
addPropertyChangeListener(java.lang.String propName,
java.beans.PropertyChangeListener l)
Adds a Property Change Listener. |
void |
addSourceLocator(Locator loc)
Adds a locator to the set of locators of the XML or other resources which contributed to this topic map object. |
void |
addTopicMap(TopicMap tm)
|
void |
addVetoableChangeListener(java.beans.VetoableChangeListener l)
|
Association |
createAssociation(java.lang.String id)
Creates a new Association in this TopicMap. |
Association |
createAssociation(java.lang.String id,
Locator resourceLocator,
Topic type,
Topic[] themes)
Creates a new Association in this topic map |
Topic |
createTopic(java.lang.String id)
Creates a new Topic in this TopicMap. |
void |
destroy()
Permanently removes this object from the topic map. |
void |
fireMultiValuePropertyChange(MultiValuePropertyChangeEvent ev)
Notifies the MultiValue Property Change Listeners of a property change. |
void |
fireMultiValuePropertyChange(java.lang.String propName,
int operation,
java.lang.Object operand)
Notifies the MultiValue Property Change Listeners of a property change to this object |
void |
firePropertyChange(java.beans.PropertyChangeEvent ev)
Notifies the Property Change Listeners of a property change. |
void |
firePropertyChange(java.lang.String propName,
java.lang.Object oldVal,
java.lang.Object newVal)
Notifies a Property Change Listener of a property change. |
void |
fireVetoableChange(java.beans.PropertyChangeEvent ev)
|
void |
fireVetoableChange(java.lang.String propertyName,
java.lang.Object oldVal,
java.lang.Object newVal)
|
java.util.Collection |
getAddedThemes()
Get a list of the Topic objects defining the added themes of the topic map. |
java.util.Collection |
getAssociations()
Get a list of the Associations contained in the topic map. |
java.util.Iterator |
getAssociationsIterator()
Get an iterator over all of the Associations in the topic map. |
Locator |
getBaseLocator()
Returns the Locator for the address of the source which generated the topic map. |
java.util.Set |
getExternalRefs()
Returns all of the unresolved external references from this topic map. |
TopicMapFactory |
getFactory()
Get the concrete implementation of the TopicMapFactory interface which partners with the concrete implementation of this interface. |
java.lang.String |
getID()
Returns the object ID of the TopicMapObject. |
IndexManager |
getIndexManager()
Returns the IndexManager object which handles access to all of the indexes for this topic map. |
LocatorFactory |
getLocatorFactory()
Get the concrete implementation of the LocatorFactory interface which partners with the concrete implementation of this interface. |
java.util.Collection |
getMergedTopics(Topic t)
|
java.util.Collection |
getMergedTopics(UnifiedTopic t)
|
java.util.Set |
getMergeMapAddedThemes(Locator mapLoc)
Returns the collection of themes to be added to the external topic map resource when it is merged with this map. |
java.util.Collection |
getMergeMapLocators()
Returns an unmodifiable Map of the unresolved mergeMap directives contained within this topic map. |
java.lang.String |
getName()
getName Get the name of the topic map. |
TopicMapObject |
getObjectByID(java.lang.String id)
Gets the object with the specified unique identifier. |
TopicMapObject |
getObjectByResourceLocator(Locator loc)
Gets the TopicMapObject which was generated from the specified resource. |
TopicMapObject |
getObjectBySourceLocator(Locator loc)
Gets the TopicMapObject which was generated from the specified resource. |
java.util.Collection |
getObjects()
Gets all the objects in the topic map. |
java.lang.Boolean |
getProperty(java.lang.String propertyName)
Returns the value of the specified property for one of the underlying topic maps. |
TopicMapProvider |
getProvider()
Returns the TopicMapProvider implementation which provides this TopicMap |
Locator |
getResourceLocator()
Returns the Locator of the XML or other resource which caused the creation of this topic map object. |
java.util.Set |
getSourceLocators()
Returns the Locators of the XML or other resources which contributed to this topic map object. |
Topic |
getTopicByID(java.lang.String id)
Returns the UnifiedTopic which wraps the topic object specified by the id string. |
Topic |
getTopicBySubject(Locator subject)
Get the topic which is bound to the specified subject |
Topic |
getTopicBySubjectIndicator(Locator subjectIndicator)
Get the topic which is bound to the subject indicated by the specified resource. |
int |
getTopicCount()
Returns a count of the total number of raw topics in all underlying topic maps. |
TopicMap |
getTopicMap()
Returns a handle to the topic map which this object is part of. |
TopicMap |
getTopicMap(java.lang.String id)
|
java.util.Collection |
getTopicMaps()
|
java.util.Set |
getTopics()
Returns the raw topics in all of the underlying topic maps. |
java.util.Iterator |
getTopicsIterator()
Get an Iterator over the Topics in this map. |
java.util.Set |
getUnifiedTopics()
|
java.util.Collection |
getUnifiedTopics(java.util.Collection rawTopics)
|
TopicMapUtils |
getUtils()
Get the concrete implementation of the TopicMapUtils interface which partners with the concrete implementation of this interface. |
boolean |
hasMergeMap()
|
boolean |
hasMergeMap(Locator loc)
Determine whether or not the specified resource is listed in an unresolved mergeMap directive for this topic map. |
void |
propertyChange(java.beans.PropertyChangeEvent ev)
|
void |
removeAssociation(Association assoc)
|
void |
removeExternalRef(Locator ref)
Removes a resource from the list of external references of this topic map. |
void |
removeMergeMap(Locator mapLoc)
Removes an unresolved mergeMap directive from this topic map. |
void |
removeMultiValuePropertyChangeListener(MultiValuePropertyChangeListener l)
Removes a MultiValue Property Change Listener. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a Property Change Listener. |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Removes a Property Change listener for a specific property |
void |
removeSourceLocator(Locator loc)
Removes a locator from the set of locators of the XML or other resources which contributed to this topic map object. |
void |
removeTopic(Topic t)
|
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener l)
|
void |
setBaseLocator(Locator base)
Sets the Locator of the source which generated this topic map. |
void |
setID(java.lang.String id)
Sets the object ID of the TopicMapObject. |
void |
setName(java.lang.String name)
setName Set the name of the topic map. |
void |
setResourceLocator(Locator loc)
Sets the Locator of the XML or other resource which caused the creation of this topic map object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UnifiedTopicMap(Locator baseLocator)
public UnifiedTopicMap(Locator baseLocator, boolean notifyEvents)
Method Detail |
public TopicMapProvider getProvider()
TopicMap
getProvider
in interface TopicMap
public void addTopicMap(TopicMap tm) throws UnifiedTopicMapException
UnifiedTopicMapException
public TopicMap getTopicMap(java.lang.String id)
public java.util.Collection getTopicMaps()
public java.util.Collection getUnifiedTopics(java.util.Collection rawTopics)
public java.util.Collection getMergedTopics(UnifiedTopic t)
public java.util.Collection getMergedTopics(Topic t)
public void addAddedTheme(Topic theme)
TopicMap
addAddedTheme
in interface TopicMap
public void addExternalRef(Locator ref)
TopicMap
addExternalRef
in interface TopicMap
ref
- The external locator to be added. If the referenced resource is already contained as an external reference or as a merge map, it will not be added. For the purposes of this check, the fragment and query parts of a URILocator are ignored, and only the reference to the complete document will be stored
For example if the reference is to http://www.tm4j.org/example.xtm#topic1, the locator which is tested for and stored will be http://www.tm4j.org/example.xtm This means that multiple references to different topics in the same external topic map will only ever create one external reference.
For other locator notations the complete address is used for this test.
public void addMergeMap(Locator ref, Topic[] addThemes)
TopicMap
addMergeMap
in interface TopicMap
ref
- The Locator of the external topic map to be mergedaddThemes
- An array of Topic objects containing the themes to be added to
the topic map when it is merged. Null if there are no themes to be added.public java.util.Collection getAddedThemes()
TopicMap
getAddedThemes
in interface TopicMap
Topic
public java.util.Collection getAssociations()
TopicMap
getAssociations
in interface TopicMap
Association
public java.util.Iterator getAssociationsIterator()
TopicMap
getAssociationsIterator
in interface TopicMap
public Locator getBaseLocator()
TopicMap
getBaseLocator
in interface TopicMap
public java.util.Set getExternalRefs()
TopicMap
getExternalRefs
in interface TopicMap
public TopicMapFactory getFactory()
TopicMap
getFactory
in interface TopicMap
public IndexManager getIndexManager()
TopicMap
getIndexManager
in interface TopicMap
public LocatorFactory getLocatorFactory()
TopicMap
getLocatorFactory
in interface TopicMap
public java.util.Set getMergeMapAddedThemes(Locator mapLoc)
TopicMap
getMergeMapAddedThemes
in interface TopicMap
mapLoc
- The Locator of the external topic map to
be merged.
mapLocator
specifies the locator of
an external topic map to be merged into this topic map,
a Set of Topic objects defining the themes to be added to the
external topic map will be returned. Otherwise, null is returned.public java.util.Collection getMergeMapLocators()
TopicMap
getMergeMapLocators
in interface TopicMap
public boolean hasMergeMap(Locator loc)
TopicMap
hasMergeMap
in interface TopicMap
loc
- The Locator of the external topic map to test for
public java.lang.String getName()
TopicMap
getName
in interface TopicMap
public TopicMapObject getObjectByID(java.lang.String id)
TopicMap
getObjectByID
in interface TopicMap
id
- The unique identifier of the object to be retrieved.
public TopicMapObject getObjectByResourceLocator(Locator loc)
TopicMap
getObjectByResourceLocator
in interface TopicMap
loc
- The Locator of the resource to look for.
locator
public TopicMapObject getObjectBySourceLocator(Locator loc)
TopicMap
getObjectBySourceLocator
in interface TopicMap
loc
- The Locator of the resource to look for.
locator
public java.util.Collection getObjects()
TopicMap
getObjects
in interface TopicMap
public java.util.Set getTopics()
getUnifiedTopics()
getTopics
in interface TopicMap
public java.util.Iterator getTopicsIterator()
TopicMap
getTopicsIterator
in interface TopicMap
public java.util.Set getUnifiedTopics()
public int getTopicCount()
getUnifiedTopics()
due to cross-topic-map
merges.
getTopicCount
in interface TopicMap
public Topic getTopicByID(java.lang.String id)
getTopicByID
in interface TopicMap
id
- The identifier of the topic to be retrieved.
public Topic getTopicBySubject(Locator subject)
TopicMap
getTopicBySubject
in interface TopicMap
subject
- The locator of the subject to which the topic is bound
public Topic getTopicBySubjectIndicator(Locator subjectIndicator)
TopicMap
getTopicBySubjectIndicator
in interface TopicMap
subjectIndicator
- The locator of a resource which indicates the subject of the topic.
public TopicMapUtils getUtils()
TopicMap
getUtils
in interface TopicMap
public boolean hasMergeMap()
public void removeAssociation(Association assoc)
public void removeTopic(Topic t)
public Topic createTopic(java.lang.String id)
TopicMap
createTopic
in interface TopicMap
id
- the unique identifier to be assigned to the new Topic. If this
parameter is null, then the Topic will be assigned a unique
identifier by the back-end implementation.
public Association createAssociation(java.lang.String id)
TopicMap
createAssociation
in interface TopicMap
id
- the unique identifier to be assigned to the new Association. If this
parameter is null, then the Association will be assigned a unique
identifier by the back-end implementation.
public Association createAssociation(java.lang.String id, Locator resourceLocator, Topic type, Topic[] themes) throws DuplicateObjectIDException, DuplicateResourceLocatorException, java.beans.PropertyVetoException
TopicMap
createAssociation
in interface TopicMap
id
- the unique identifier to be assigned to the new Association. If this
parameter is null, then the Association will be assigned a unique
identifier by the back-end implementation.resourceLocator
- the address of the syntactic item which describes this
Association (e.g. the address of the XTM association
element). This parameter may be NULL for Associations
not created from a syntactic item with an address.type
- the topic which defines the class of associations to which the new
Association instance belongs. This parameter may be NULL for
untyped associations.themes
- the topics which define the scope of the new Association. This
parameter may be NULL for Associations created in the unconstrained
scope.
DuplicateResourceLocatorException
- if resourceLocator
is the
address of some other object in this TopicMap.
java.beans.PropertyVetoException
- if a listener to the TopicMap vetoes the creation
of this Association.
DuplicateObjectIDException
- if id
is already assigned to some
other object in this TopicMap.public void removeExternalRef(Locator ref)
TopicMap
TopicMapProvider.mergeTopicMap(TopicMap baseTopicMap, Locator externalTopicMap, Topic[] addedThemes)
removeExternalRef
in interface TopicMap
public void removeMergeMap(Locator mapLoc)
TopicMap
removeMergeMap
in interface TopicMap
mapLoc
- The Locator of the external topic map reference to
be removed.public void setBaseLocator(Locator base)
TopicMap
setBaseLocator
in interface TopicMap
base
- The base resource locator of the topic map.TopicMap.getBaseLocator()
public void setName(java.lang.String name)
TopicMap
setName
in interface TopicMap
name
- The name to be assigned to the topic map.public void setID(java.lang.String id)
TopicMapObject
setID
in interface TopicMapObject
id
- the new internal object ID.public java.lang.String getID()
TopicMapObject
TopicMapObject.getResourceLocator()
.
getID
in interface TopicMapObject
TopicMapObject.setID(java.lang.String)
public Locator getResourceLocator()
getSourceLocators()
TopicMapObject
getResourceLocator
in interface TopicMapObject
public java.util.Set getSourceLocators()
TopicMapObject
NOTE: under the dynamic merging model, calling getResourceLocators() on a Topic object will return the resourceLocator of the Topic itself, plust that of all Topics which it is merged with.
getSourceLocators
in interface TopicMapObject
public void setResourceLocator(Locator loc)
addSourceLocator(Locator)
TopicMapObject
setResourceLocator
in interface TopicMapObject
loc
- the creating Locator.public void addSourceLocator(Locator loc)
TopicMapObject
addSourceLocator
in interface TopicMapObject
loc
- the locator of the contributing resourcepublic void removeSourceLocator(Locator loc)
TopicMapObject
removeSourceLocator
in interface TopicMapObject
loc
- the locator to be removedpublic TopicMap getTopicMap()
TopicMapObject
getTopicMap
in interface TopicMapObject
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
TopicMapObject
addPropertyChangeListener
in interface TopicMapObject
l
- The new listener to be registered. It listens
for changes in all available properties.public void addPropertyChangeListener(java.lang.String propName, java.beans.PropertyChangeListener l)
TopicMapObject
addPropertyChangeListener
in interface TopicMapObject
propName
- The property whose changes the listener monitors.l
- The new listener to be registered. It only listens
for changes in the property specified by propertyName
.public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
TopicMapObject
removePropertyChangeListener
in interface TopicMapObject
l
- The listener to be removed.public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
TopicMapObject
removePropertyChangeListener
in interface TopicMapObject
propertyName
- The property that the listener should be removed fromlistener
- The listener to be removedpublic void firePropertyChange(java.lang.String propName, java.lang.Object oldVal, java.lang.Object newVal)
TopicMapObject
oldVal
equals newVal
,
no property change event is actually fired.
firePropertyChange
in interface TopicMapObject
propName
- The property for which a property change is
to be fired. The Property Change Listener
responsible for handling changes to this
particular property is selected automatically.oldVal
- The property's original value.newVal
- The property's new value.public void firePropertyChange(java.beans.PropertyChangeEvent ev)
TopicMapObject
firePropertyChange
in interface TopicMapObject
ev
- The PropertyChangeEvent to be fired.
The Property Change Listener is
responsible for handling changes to this
particular property is selected automatically.public void addMultiValuePropertyChangeListener(java.lang.String propName, MultiValuePropertyChangeListener l)
TopicMapObject
addMultiValuePropertyChangeListener
in interface TopicMapObject
propName
- The property whose changes the listener monitors.l
- The new listener to be registered. It only listens
for changes in the property specified by propertyName
.public void addMultiValuePropertyChangeListener(MultiValuePropertyChangeListener l)
TopicMapObject
addMultiValuePropertyChangeListener
in interface TopicMapObject
l
- The new listener to be registered. It listens
for changes in all available properties.public void removeMultiValuePropertyChangeListener(MultiValuePropertyChangeListener l)
TopicMapObject
removeMultiValuePropertyChangeListener
in interface TopicMapObject
l
- The listener to be removed.public void fireMultiValuePropertyChange(java.lang.String propName, int operation, java.lang.Object operand)
TopicMapObject
fireMultiValuePropertyChange
in interface TopicMapObject
propName
- The name of the property modified.operation
- The type of modification to the property. Allowed values are
specified in the class
MultiValuePropertyChangeEvent
operand
- The object or Collection of objects which were involved
in the modification. For OP_CLEAR events, no operand is
required. For OP_ADD_SINGLE or OP_REMOVE_SINGLE events,
the operand must be the object added or removed.
For OP_ADD_SET and OP_REMOVE_SET events, the operand
must be a Collection of all the objects added or removed.
For OP_SET events, the operand must be a collection of the
new values assigned to the property.public void fireMultiValuePropertyChange(MultiValuePropertyChangeEvent ev)
TopicMapObject
fireMultiValuePropertyChange
in interface TopicMapObject
ev
- The MultiValuePropertyChangeEvent to be fired.
The MultiValue Property Change Listener is
responsible for handling changes to this
particular property is selected automatically.public void addVetoableChangeListener(java.beans.VetoableChangeListener l)
addVetoableChangeListener
in interface TopicMapObject
public void removeVetoableChangeListener(java.beans.VetoableChangeListener l)
removeVetoableChangeListener
in interface TopicMapObject
public void fireVetoableChange(java.lang.String propertyName, java.lang.Object oldVal, java.lang.Object newVal) throws java.beans.PropertyVetoException
fireVetoableChange
in interface TopicMapObject
java.beans.PropertyVetoException
public void fireVetoableChange(java.beans.PropertyChangeEvent ev) throws java.beans.PropertyVetoException
java.beans.PropertyVetoException
public void destroy()
TopicMapObject
destroy
in interface TopicMapObject
public void propertyChange(java.beans.PropertyChangeEvent ev)
propertyChange
in interface java.beans.PropertyChangeListener
public java.lang.Boolean getProperty(java.lang.String propertyName)
getProperty
in interface TopicMap
propertyName
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |