|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface describes an association between one or more topics, subject
indicators, or resources.
The type of the Association is defined by an optional typing Topic
,
and its validity may or may not be restricted to a particular scope, defined by
a set of Topic
s.
An association contains one or more Member
objects whose roles may
be defined by role-specifying Topic
s.
Topic
,
Member
,
ScopedObject
Method Summary | |
void |
addMember(Member member)
Adds a new Member to the association. |
Member |
createMember(java.lang.String id)
Creates a new Member and adds it to this Association. |
Member |
createMember(java.lang.String id,
Locator resourceLoc,
Topic roleSpec,
java.util.Collection players)
Creates a new Member and adds it to this Association. |
void |
dispose()
This method should be invoked when the object is no longer needed. |
java.util.Collection |
getMembers()
Returns the Members that the Association contains. |
java.util.Collection |
getMembersOfRole(Topic roleSpec)
Returns the Member objects which play the specified role in this association. |
TopicMap |
getParent()
Returns the TopicMap object which contains this Association object. |
Topic |
getType()
Gets the Topic defining the type of the Association. |
boolean |
isOfType(Topic type)
Determines whether the type of the association is described by type . |
void |
removeMember(Member member)
Removes a member from this association. |
void |
setMembers(Member[] members)
Defines the member constructs which are members of this association. |
void |
setType(Topic type)
Sets the Topic defining the type of this Association. |
Methods inherited from interface org.tm4j.topicmap.ScopedObject |
addTheme, getScope, inScope, inScope, removeTheme, setScope |
Method Detail |
public void dispose()
ScopedObject
dispose
in interface ScopedObject
public java.util.Collection getMembers()
Member
objects
defining the members of this Association.
If no members are currently defined for this
association, the returned collection is empty;
it is never null
.public void setMembers(Member[] members) throws java.beans.PropertyVetoException
members
- the new set of members to be part of
this association. If this is null
,
all the existing members of this association
are removed.
java.beans.PropertyVetoException
public void addMember(Member member) throws java.beans.PropertyVetoException
If member
is a member of another association, then
it will be removed from that association and added to this association.
If member
is a member of this association already,
then this method has no effect.
member
- The Member to be added.
java.beans.PropertyVetoException
public Member createMember(java.lang.String id) throws DuplicateObjectIDException, java.beans.PropertyVetoException
id
- the unique ID to be assigned to the newly created Member object. If
null, then the back-end will assign a unique ID to the object.
DuplicateObjectIDException
java.beans.PropertyVetoException
public Member createMember(java.lang.String id, Locator resourceLoc, Topic roleSpec, java.util.Collection players) throws DuplicateObjectIDException, java.beans.PropertyVetoException, DuplicateResourceLocatorException
id
- the unique ID to be assigned to the newly created Member object. If
this parameter is null, then the back-end will assign a unique ID to
the object.resourceLoc
- the address of the syntactic element that caused the creation
of this Member (e.g. the address of the XTM member element). This parameter
may be null for Member objects not created from syntactic elements or created
from syntactic elements with no address.roleSpec
- the topic which defines the role played in the association. This parameter
may be null for a Member which plays no defined role in the association.players
- the role players. This parameter must be a Collection of Topics.
DuplicateObjectIDException
java.beans.PropertyVetoException
DuplicateResourceLocatorException
public void removeMember(Member member) throws java.beans.PropertyVetoException
member
- The member to be removed.
java.beans.PropertyVetoException
public Topic getType()
null
is returned.public void setType(Topic type) throws java.beans.PropertyVetoException
type
- The Topic to define the type of the association.
java.beans.PropertyVetoException
public boolean isOfType(Topic type)
type
.
true
if the type of this Association is defined by the topic
type
, false
otherwise.public java.util.Collection getMembersOfRole(Topic roleSpec)
roleSpec
- The Topic specifying the role that the returned Members must play.
public TopicMap getParent()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |