org.tm4j.topicmap
Interface Member

All Superinterfaces:
TopicMapObject
All Known Implementing Classes:
UnifiedMember

public interface Member
extends TopicMapObject

Represents a member of an association. Members may be typed by a single topic (the roleSpec property) and are defined by zero or more topics. Note that in this definition, members are exclusively defined by Topics — implementations must ensure that when processing XTM documents, the following rules are obeyed while parsing a <member> element:

Author:
Kal Ahmed
See Also:
Topic.addSubjectIndicator(org.tm4j.net.Locator), Topic.setSubjectIndicators(org.tm4j.net.Locator[]), Topic.setSubject(org.tm4j.net.Locator)

Method Summary
 void addPlayer(Topic player)
          Adds a topic as a player, meaning one of the topics that define this member.
 Association getParent()
          Returns the association to which the Member belongs.
 java.util.Collection getPlayers()
          Returns an unmodifiable collection of the Topics which are players of this Member.
 Topic getRoleSpec()
          Returns the topic which defines the type of this Member.
 void removePlayer(Topic player)
          Removes the specified topic from the list of players of this Member object.
 void setPlayers(Topic[] players)
          Sets the collection of Topics which are players of this Member.
 void setRoleSpec(Topic roleSpec)
          Sets the topic which defines the type of this Member.
 
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

getParent

public Association getParent()
Returns the association to which the Member belongs.

Returns:
The member's parent association, or null if the member is currently not part of any association.

getRoleSpec

public Topic getRoleSpec()
Returns the topic which defines the type of this Member.

Returns:
The role-defining topic of this member.

setRoleSpec

public void setRoleSpec(Topic roleSpec)
                 throws java.beans.PropertyVetoException
Sets the topic which defines the type of this Member. If the Member already has a type defined, then the existing type is replaced by the new one.

Parameters:
roleSpec - the new role-defining topic of this member.
Throws:
java.beans.PropertyVetoException

addPlayer

public void addPlayer(Topic player)
               throws java.beans.PropertyVetoException
Adds a topic as a player, meaning one of the topics that define this member. A topic may be a player in multiple Members of multiple Associations.

Parameters:
player - the topic to be added to the set of topics that define this member.
Throws:
java.beans.PropertyVetoException

removePlayer

public void removePlayer(Topic player)
                  throws java.beans.PropertyVetoException
Removes the specified topic from the list of players of this Member object. If the specified Topic is not in the list of players for this Member object, then this method has no effect.

Parameters:
player - the topic to be removed from the set of topics that define this member.
Throws:
java.beans.PropertyVetoException

getPlayers

public java.util.Collection getPlayers()
Returns an unmodifiable collection of the Topics which are players of this Member.

Returns:
The collection of Topics that define this member. If no players are currently defined for this member, the returned collection is empty; it is never null.

setPlayers

public void setPlayers(Topic[] players)
                throws java.beans.PropertyVetoException
Sets the collection of Topics which are players of this Member. The specified array replaces all the existing players of this Member.

Parameters:
players - the new set of topics to define this member. If this is null, all the existing players of this member are removed.
Throws:
java.beans.PropertyVetoException