org.tm4j.topicmap.unified
Class UnifiedTopicMapObject

java.lang.Object
  extended byorg.tm4j.topicmap.unified.UnifiedTopicMapObject
All Implemented Interfaces:
TopicMapObject
Direct Known Subclasses:
UnifiedMember, UnifiedScopedObject, UnifiedTopic, UnifiedVariant

public class UnifiedTopicMapObject
extends java.lang.Object
implements TopicMapObject


Field Summary
protected  UnifiedTopicMap m_tm
           
 
Method Summary
 void addMultiValuePropertyChangeListener(MultiValuePropertyChangeListener listener)
          Adds a MultiValue Property Change Listener.
 void addMultiValuePropertyChangeListener(java.lang.String propertyName, MultiValuePropertyChangeListener listener)
          Adds a MultiValue Property Change Listener.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a Property Change Listener.
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          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 addVetoableChangeListener(java.beans.VetoableChangeListener listener)
           
 void destroy()
          Permanently removes this object from the topic map.
 boolean equals(java.lang.Object other)
           
 void fireMultiValuePropertyChange(MultiValuePropertyChangeEvent propertyChange)
          Notifies the MultiValue Property Change Listeners of a property change.
 void fireMultiValuePropertyChange(java.lang.String propertyName, int operation, java.lang.Object operand)
          Notifies the MultiValue Property Change Listeners of a property change to this object
 void firePropertyChange(java.beans.PropertyChangeEvent propertyChange)
          Notifies the Property Change Listeners of a property change.
 void firePropertyChange(java.lang.String propertyName, int operation, java.lang.Object operand)
           
 void firePropertyChange(java.lang.String propertyName, 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)
           
protected  TopicMapObject getBaseObject()
           
 java.lang.String getID()
          Returns the object ID of the TopicMapObject.
 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.
 TopicMap getTopicMap()
          Returns a handle to the topic map which this object is part of.
 int hashCode()
           
 void removeMultiValuePropertyChangeListener(MultiValuePropertyChangeListener listener)
          Removes a MultiValue Property Change Listener.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          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 removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
           
 void setID(java.lang.String id)
          Sets the object ID of the TopicMapObject.
 void setResourceLocator(Locator loc)
          Sets the Locator of the XML or other resource which caused the creation of this topic map object.
protected  void unsupported()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_tm

protected UnifiedTopicMap m_tm
Method Detail

setID

public void setID(java.lang.String id)
Description copied from interface: TopicMapObject
Sets the object ID of the TopicMapObject. The object ID is an internal identifier assigned by the application to a topic map object. ID values must be unique for each object in the same topic map. Implementations are free to assign ID values in any way they see fit.

Specified by:
setID in interface TopicMapObject
Parameters:
id - the new internal object ID.

getID

public java.lang.String getID()
Description copied from interface: TopicMapObject
Returns the object ID of the TopicMapObject. Note that implementations are free to assign ID values in any way they see fit. To get the Locator of the XTM element which is represented by this object, use TopicMapObject.getResourceLocator().

Specified by:
getID in interface TopicMapObject
Returns:
the internal object ID.
See Also:
TopicMapObject.setID(java.lang.String)

getResourceLocator

public Locator getResourceLocator()
Deprecated. use getSourceLocators()

Description copied from interface: TopicMapObject
Returns the Locator of the XML or other resource which caused the creation of this topic map object.

Specified by:
getResourceLocator in interface TopicMapObject
Returns:
The creating Locator.

getSourceLocators

public java.util.Set getSourceLocators()
Description copied from interface: TopicMapObject
Returns the Locators of the XML or other resources which contributed to this topic map object.

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.

Specified by:
getSourceLocators in interface TopicMapObject
Returns:
an unmodifiable Set of Locator objects.

setResourceLocator

public void setResourceLocator(Locator loc)
Deprecated. use addSourceLocator(Locator)

Description copied from interface: TopicMapObject
Sets the Locator of the XML or other resource which caused the creation of this topic map object. Typically, this will be the Locator of an XTM element.

Specified by:
setResourceLocator in interface TopicMapObject
Parameters:
loc - the creating Locator.

addSourceLocator

public void addSourceLocator(Locator loc)
Description copied from interface: TopicMapObject
Adds a locator to the set of locators of the XML or other resources which contributed to this topic map object.

Specified by:
addSourceLocator in interface TopicMapObject
Parameters:
loc - the locator of the contributing resource

removeSourceLocator

public void removeSourceLocator(Locator loc)
Description copied from interface: TopicMapObject
Removes a locator from the set of locators of the XML or other resources which contributed to this topic map object.

Specified by:
removeSourceLocator in interface TopicMapObject
Parameters:
loc - the locator to be removed

getTopicMap

public TopicMap getTopicMap()
Description copied from interface: TopicMapObject
Returns a handle to the topic map which this object is part of.

Specified by:
getTopicMap in interface TopicMapObject
Returns:
This object's parent topic map.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface: TopicMapObject
Adds a Property Change Listener. The listener is registered for all properties.

Specified by:
addPropertyChangeListener in interface TopicMapObject
Parameters:
listener - The new listener to be registered. It listens for changes in all available properties.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface: TopicMapObject
Removes a Property Change Listener.

Specified by:
removePropertyChangeListener in interface TopicMapObject
Parameters:
listener - The listener to be removed.

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String propertyName,
                                         java.beans.PropertyChangeListener listener)
Description copied from interface: TopicMapObject
Removes a Property Change listener for a specific property

Specified by:
removePropertyChangeListener in interface TopicMapObject
Parameters:
propertyName - The property that the listener should be removed from
listener - The listener to be removed

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener listener)
Description copied from interface: TopicMapObject
Adds a Property Change Listener. The listener is registered for only one property.

Specified by:
addPropertyChangeListener in interface TopicMapObject
Parameters:
propertyName - The property whose changes the listener monitors.
listener - The new listener to be registered. It only listens for changes in the property specified by propertyName.

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               java.lang.Object oldVal,
                               java.lang.Object newVal)
Description copied from interface: TopicMapObject
Notifies a Property Change Listener of a property change. Note that if oldVal equals newVal, no property change event is actually fired.

Specified by:
firePropertyChange in interface TopicMapObject
Parameters:
propertyName - 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.

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               int operation,
                               java.lang.Object operand)

firePropertyChange

public void firePropertyChange(java.beans.PropertyChangeEvent propertyChange)
Description copied from interface: TopicMapObject
Notifies the Property Change Listeners of a property change.

Specified by:
firePropertyChange in interface TopicMapObject
Parameters:
propertyChange - The PropertyChangeEvent to be fired. The Property Change Listener is responsible for handling changes to this particular property is selected automatically.

hashCode

public int hashCode()

addMultiValuePropertyChangeListener

public void addMultiValuePropertyChangeListener(java.lang.String propertyName,
                                                MultiValuePropertyChangeListener listener)
Description copied from interface: TopicMapObject
Adds a MultiValue Property Change Listener. The listener is registered for only one property.

Specified by:
addMultiValuePropertyChangeListener in interface TopicMapObject
Parameters:
propertyName - The property whose changes the listener monitors.
listener - The new listener to be registered. It only listens for changes in the property specified by propertyName.

addMultiValuePropertyChangeListener

public void addMultiValuePropertyChangeListener(MultiValuePropertyChangeListener listener)
Adds a MultiValue Property Change Listener. The listener is registered for all properties.

Specified by:
addMultiValuePropertyChangeListener in interface TopicMapObject
Parameters:
listener - The new listener to be registered. It listens for changes in all available properties.

removeMultiValuePropertyChangeListener

public void removeMultiValuePropertyChangeListener(MultiValuePropertyChangeListener listener)
Removes a MultiValue Property Change Listener.

Specified by:
removeMultiValuePropertyChangeListener in interface TopicMapObject
Parameters:
listener - The listener to be removed.

fireMultiValuePropertyChange

public void fireMultiValuePropertyChange(java.lang.String propertyName,
                                         int operation,
                                         java.lang.Object operand)
Description copied from interface: TopicMapObject
Notifies the MultiValue Property Change Listeners of a property change to this object

Specified by:
fireMultiValuePropertyChange in interface TopicMapObject
Parameters:
propertyName - 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.

fireMultiValuePropertyChange

public void fireMultiValuePropertyChange(MultiValuePropertyChangeEvent propertyChange)
Description copied from interface: TopicMapObject
Notifies the MultiValue Property Change Listeners of a property change.

Specified by:
fireMultiValuePropertyChange in interface TopicMapObject
Parameters:
propertyChange - The MultiValuePropertyChangeEvent to be fired. The MultiValue Property Change Listener is responsible for handling changes to this particular property is selected automatically.

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Specified by:
addVetoableChangeListener in interface TopicMapObject

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Specified by:
removeVetoableChangeListener in interface TopicMapObject

fireVetoableChange

public void fireVetoableChange(java.lang.String propertyName,
                               java.lang.Object oldVal,
                               java.lang.Object newVal)
                        throws java.beans.PropertyVetoException
Specified by:
fireVetoableChange in interface TopicMapObject
Throws:
java.beans.PropertyVetoException

fireVetoableChange

public void fireVetoableChange(java.beans.PropertyChangeEvent ev)
                        throws java.beans.PropertyVetoException
Throws:
java.beans.PropertyVetoException

destroy

public void destroy()
Description copied from interface: TopicMapObject
Permanently removes this object from the topic map. Depending upon the backend implementation, this method may also free up the memory or other storage space used by the object. An object may only be destroyed after all references to it from other objects have been removed. If the object detects that there is an existing reference still held to it, then an IntegrityViolationException is thrown

Specified by:
destroy in interface TopicMapObject

unsupported

protected void unsupported()

getBaseObject

protected TopicMapObject getBaseObject()

equals

public boolean equals(java.lang.Object other)