org.tm4j.topicmap
Interface ScopedObject

All Superinterfaces:
TopicMapObject
All Known Subinterfaces:
Association, BaseName, Occurrence
All Known Implementing Classes:
UnifiedAssociation, UnifiedBaseName, UnifiedOccurrence, UnifiedScopedObject

public interface ScopedObject
extends TopicMapObject

This interface describes a Topic Map construct which is scoped, and whose validity is thereby constrained to the set of topics that comprise the scope. Associations, BaseNames, and Occurrences may be restricted by a scope.

Author:
Kal Ahmed

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[] scopingTopics)
          Sets the collection of topics which define the scope of validity for this object.
 
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
 

Method Detail

dispose

public void dispose()
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.


getScope

public java.util.Set getScope()
Gets the collection of topics which define the scope of validity for this object.

Returns:
a Set of Topic objects.

setScope

public void setScope(Topic[] scopingTopics)
              throws java.beans.PropertyVetoException
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.

Parameters:
scopingTopics - the new set of scoping topics for this object
Throws:
java.beans.PropertyVetoException - if the update of the scope is vetoed by a listener

addTheme

public void addTheme(Topic theme)
              throws java.beans.PropertyVetoException
Adds a topic to the collection which define the scope of validity for this object.

Parameters:
theme - the scoping topic to be added
Throws:
java.beans.PropertyVetoException - if the update of the scope is vetoed by a listener

removeTheme

public void removeTheme(Topic theme)
                 throws java.beans.PropertyVetoException
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.

Parameters:
theme - the topic to be removed.
Throws:
java.beans.PropertyVetoException - if the update of the scope is vetoed by a listener

inScope

public boolean inScope(Topic theme)
Determines whether the specified theme is in the scope of this object.

Returns:
true if the specified theme is in the scope of this object, false otherwise.

inScope

public boolean inScope(Topic[] themes)
Determines whether one or more of the specified themes are in the scope of this object.

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