public class DatabaseAssociation extends java.lang.Object implements Association
Modifier and Type | Field and Description |
---|---|
protected boolean |
full |
protected java.lang.String |
id |
private static int |
idcounter |
protected java.util.Map<Topic,Topic> |
players |
protected boolean |
removed |
protected DatabaseTopicMap |
topicMap |
protected DatabaseTopic |
type |
Constructor and Description |
---|
DatabaseAssociation(DatabaseTopic type,
DatabaseTopicMap topicMap)
Creates a new instance of DatabaseAssociation
|
DatabaseAssociation(DatabaseTopic type,
java.lang.String id,
DatabaseTopicMap topicMap) |
DatabaseAssociation(java.util.Map<java.lang.String,java.lang.Object> row,
DatabaseTopicMap topicMap) |
DatabaseAssociation(java.lang.String id,
DatabaseTopicMap topicMap) |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
_equals(DatabaseAssociation 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> players)
Adds players to the association.
|
void |
checkRedundancy() |
(package private) void |
create() |
protected java.lang.String |
escapeSQL(java.lang.String s) |
java.lang.String |
getID() |
Topic |
getPlayer(Topic role)
Gets the player with the specified role.
|
java.util.Collection<Topic> |
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.
|
(package private) void |
initialize(DatabaseTopic type) |
boolean |
isRemoved()
Tests if this association has been removed and thus this object is now
invalid.
|
(package private) void |
makeFull() |
(package private) static java.util.HashMap<java.lang.String,DatabaseTopic> |
makeFullAll(java.util.Collection<java.util.Map<java.lang.String,java.lang.Object>> res,
java.util.HashMap<java.lang.String,DatabaseAssociation> associations,
DatabaseTopicMap topicMap) |
protected static java.lang.String |
makeID() |
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.
|
protected DatabaseTopicMap topicMap
protected java.lang.String id
protected boolean full
protected DatabaseTopic type
protected boolean removed
private static int idcounter
public DatabaseAssociation(DatabaseTopic type, DatabaseTopicMap topicMap)
public DatabaseAssociation(DatabaseTopic type, java.lang.String id, DatabaseTopicMap topicMap)
public DatabaseAssociation(java.lang.String id, DatabaseTopicMap topicMap)
public DatabaseAssociation(java.util.Map<java.lang.String,java.lang.Object> row, DatabaseTopicMap topicMap) throws TopicMapException
TopicMapException
void initialize(DatabaseTopic type)
protected java.lang.String escapeSQL(java.lang.String s)
protected static java.lang.String makeID()
public java.lang.String getID()
void create() throws TopicMapException
TopicMapException
static java.util.HashMap<java.lang.String,DatabaseTopic> makeFullAll(java.util.Collection<java.util.Map<java.lang.String,java.lang.Object>> res, java.util.HashMap<java.lang.String,DatabaseAssociation> associations, DatabaseTopicMap topicMap) throws TopicMapException
TopicMapException
void makeFull() throws TopicMapException
TopicMapException
public Topic getType() throws TopicMapException
Association
getType
in interface Association
TopicMapException
public void setType(Topic t) throws TopicMapException
Association
setType
in interface Association
TopicMapException
public Topic getPlayer(Topic role) throws TopicMapException
Association
getPlayer
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> players) throws TopicMapException
Association
addPlayers
in interface Association
TopicMapException
public void removePlayer(Topic role) throws TopicMapException
Association
removePlayer
in interface Association
TopicMapException
public java.util.Collection<Topic> getRoles() throws TopicMapException
Association
getRoles
in interface Association
TopicMapException
public TopicMap getTopicMap()
Association
getTopicMap
in interface Association
public void remove() throws TopicMapException
Association
remove
in interface Association
TopicMapException
public boolean isRemoved() throws TopicMapException
Association
isRemoved
in interface Association
TopicMapException
public void checkRedundancy() throws TopicMapException
TopicMapException
boolean _equals(DatabaseAssociation a)
int _hashCode()
Copyright 2004-2015 Wandora Team