public class AssociationImpl extends java.lang.Object implements Association
Modifier and Type | Field and Description |
---|---|
private java.util.Map<Topic,Topic> |
players |
private boolean |
removed |
private TopicMapImpl |
topicMap |
private Topic |
type |
Constructor and Description |
---|
AssociationImpl(TopicMapImpl topicMap,
Topic type)
Creates a new instance of AssociationImpl
|
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
_equals(AssociationImpl a) |
(package private) int |
_hashCode() |
void |
addPlayer(Topic player,
Topic role)
Sets the player with the specified role replacing previous player with
that role if it exists already.
|
void |
addPlayers(java.util.Map<Topic,Topic> newPlayers)
Adds players to the association.
|
(package private) void |
checkRedundancy() |
Topic |
getPlayer(Topic role)
Gets the player with the specified role.
|
java.util.Collection |
getRoles()
Gets a Collection of Topics containing the roles of this association.
|
TopicMap |
getTopicMap()
Gets the topic map this association belongs to.
|
Topic |
getType()
Gets the type of this association.
|
boolean |
isRemoved()
Tests if this association has been removed and thus this object is now
invalid.
|
void |
remove()
Removes this association.
|
void |
removePlayer(Topic role)
Removes the player with the specified role.
|
void |
setType(Topic t)
Sets the type of this association replacing the previous type.
|
private TopicMapImpl topicMap
private Topic type
private boolean removed
public AssociationImpl(TopicMapImpl topicMap, Topic type) throws TopicMapException
TopicMapException
public Topic getPlayer(Topic role)
Association
getPlayer
in interface Association
public java.util.Collection getRoles()
Association
getRoles
in interface Association
public TopicMap getTopicMap()
Association
getTopicMap
in interface Association
public Topic getType()
Association
getType
in interface Association
public void setType(Topic t) throws TopicMapException
Association
setType
in interface Association
TopicMapException
public void addPlayer(Topic player, Topic role) throws TopicMapException
Association
addPlayer
in interface Association
TopicMapException
public void addPlayers(java.util.Map<Topic,Topic> newPlayers) throws TopicMapException
Association
addPlayers
in interface Association
TopicMapException
public void removePlayer(Topic role) throws TopicMapException
Association
removePlayer
in interface Association
TopicMapException
public void remove() throws TopicMapException
Association
remove
in interface Association
TopicMapException
public boolean isRemoved()
Association
isRemoved
in interface Association
void checkRedundancy() throws TopicMapException
TopicMapException
int _hashCode()
boolean _equals(AssociationImpl a)
Copyright 2004-2015 Wandora Team