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
TopicMapExceptionvoid 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
TopicMapExceptionstatic 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
TopicMapExceptionvoid makeFull()
throws TopicMapException
TopicMapExceptionpublic Topic getType() throws TopicMapException
AssociationgetType in interface AssociationTopicMapExceptionpublic void setType(Topic t) throws TopicMapException
AssociationsetType in interface AssociationTopicMapExceptionpublic Topic getPlayer(Topic role) throws TopicMapException
AssociationgetPlayer in interface AssociationTopicMapExceptionpublic void addPlayer(Topic player, Topic role) throws TopicMapException
AssociationaddPlayer in interface AssociationTopicMapExceptionpublic void addPlayers(java.util.Map<Topic,Topic> players) throws TopicMapException
AssociationaddPlayers in interface AssociationTopicMapExceptionpublic void removePlayer(Topic role) throws TopicMapException
AssociationremovePlayer in interface AssociationTopicMapExceptionpublic java.util.Collection<Topic> getRoles() throws TopicMapException
AssociationgetRoles in interface AssociationTopicMapExceptionpublic TopicMap getTopicMap()
AssociationgetTopicMap in interface Associationpublic void remove()
throws TopicMapException
Associationremove in interface AssociationTopicMapExceptionpublic boolean isRemoved()
throws TopicMapException
AssociationisRemoved in interface AssociationTopicMapExceptionpublic void checkRedundancy()
throws TopicMapException
TopicMapExceptionboolean _equals(DatabaseAssociation a)
int _hashCode()
Copyright 2004-2015 Wandora Team