org.tm4j.topicmap.unified
Class UnifiedScopedObject

java.lang.Object
  extended byorg.tm4j.topicmap.unified.UnifiedTopicMapObject
      extended byorg.tm4j.topicmap.unified.UnifiedScopedObject
All Implemented Interfaces:
ScopedObject, TopicMapObject
Direct Known Subclasses:
UnifiedAssociation, UnifiedBaseName, UnifiedOccurrence

public class UnifiedScopedObject
extends UnifiedTopicMapObject
implements ScopedObject


Field Summary
 
Fields inherited from class org.tm4j.topicmap.unified.UnifiedTopicMapObject
m_tm
 
Constructor Summary
UnifiedScopedObject(UnifiedTopicMap tm, ScopedObject base)
           
 
Method Summary
 void addTheme(Topic theme)
          Adds a topic to the collection which define the scope of validity for this object.
 void dispose()
          This method should be invoked when the object is no longer needed.
 java.util.Set getScope()
          Gets the collection of topics which define the scope of validity for this object.
 boolean inScope(Topic theme)
          Determines whether the specified theme is in the scope of this object.
 boolean inScope(Topic[] themes)
          Determines whether one or more of the specified themes are in the scope of this object.
 void removeTheme(Topic theme)
          Removes a topic from the collection which defines the scope of validity for this object.
 void setScope(Topic[] themes)
          Sets the collection of topics which define the scope of validity for this object.
 
Methods inherited from class org.tm4j.topicmap.unified.UnifiedTopicMapObject
addMultiValuePropertyChangeListener, addMultiValuePropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addSourceLocator, addVetoableChangeListener, destroy, equals, fireMultiValuePropertyChange, fireMultiValuePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getBaseObject, getID, getResourceLocator, getSourceLocators, getTopicMap, hashCode, removeMultiValuePropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener, removeSourceLocator, removeVetoableChangeListener, setID, setResourceLocator, unsupported
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.tm4j.topicmap.TopicMapObject
addMultiValuePropertyChangeListener, addMultiValuePropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addSourceLocator, addVetoableChangeListener, destroy, fireMultiValuePropertyChange, fireMultiValuePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getID, getResourceLocator, getSourceLocators, getTopicMap, removeMultiValuePropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener, removeSourceLocator, removeVetoableChangeListener, setID, setResourceLocator
 

Constructor Detail

UnifiedScopedObject

public UnifiedScopedObject(UnifiedTopicMap tm,
                           ScopedObject base)
Method Detail

addTheme

public void addTheme(Topic theme)
Description copied from interface: ScopedObject
Adds a topic to the collection which define the scope of validity for this object.

Specified by:
addTheme in interface ScopedObject
Parameters:
theme - the scoping topic to be added

dispose

public void dispose()
Description copied from interface: ScopedObject
This method should be invoked when the object is no longer needed. Its implementation should ensure that any contained objects are disposed and that any external references are cleared out.

Specified by:
dispose in interface ScopedObject

getScope

public java.util.Set getScope()
Description copied from interface: ScopedObject
Gets the collection of topics which define the scope of validity for this object.

Specified by:
getScope in interface ScopedObject
Returns:
a Set of Topic objects.

inScope

public boolean inScope(Topic theme)
Description copied from interface: ScopedObject
Determines whether the specified theme is in the scope of this object.

Specified by:
inScope in interface ScopedObject
Returns:
true if the specified theme is in the scope of this object, false otherwise.

inScope

public boolean inScope(Topic[] themes)
Description copied from interface: ScopedObject
Determines whether one or more of the specified themes are in the scope of this object.

Specified by:
inScope in interface ScopedObject
Returns:
true if the one or more of the specified themes are in the scope of this object, false otherwise.

removeTheme

public void removeTheme(Topic theme)
Description copied from interface: ScopedObject
Removes a topic from the collection which defines the scope of validity for this object. This method has no effect if theme is not a part of the set of scoping topics for this object.

Specified by:
removeTheme in interface ScopedObject
Parameters:
theme - the topic to be removed.

setScope

public void setScope(Topic[] themes)
Description copied from interface: ScopedObject
Sets the collection of topics which define the scope of validity for this object. The input array will be processed to a set, removing any duplicate Topics. For the purposes of defining scope, merging will not be considered. So if topic A and B are two different topics and are in the array scopingTopics getScope() will return a two element collection, regardless of whether A and B are merged at the time of addition or merging of the topics happens after their addition to the collection.

Specified by:
setScope in interface ScopedObject
Parameters:
themes - the new set of scoping topics for this object