Package systems.dmx.core
Interface Assoc
-
- All Superinterfaces:
DMXObject
,Identifiable
,JSONEnabled
- All Known Subinterfaces:
CompDef
,RelatedAssoc
public interface Assoc extends DMXObject
An association with 2 ends. At each end can be aDMXObject
, that is either aTopic
or anotherAssoc
.- Author:
- Jörg Richter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DMXObject
getDMXObject1()
DMXObject
getDMXObject2()
<O extends RelatedObject>
OgetDMXObjectByRole(String roleTypeUri)
TODO: rename method to "getPlayerObjectByRole"<O extends RelatedObject>
OgetDMXObjectByType(String topicTypeUri)
TODO: rename method to "getPlayerObjectByType"AssocModel
getModel()
long
getOtherPlayerId(long id)
Player
getPlayer1()
Player
getPlayer2()
Player
getPlayerByRole(String roleTypeUri)
boolean
hasSameRoleTypeUris()
boolean
matches(String roleTypeUri1, long playerId1, String roleTypeUri2, long playerId2)
Checks if the given players match this association.int
playerCount(String roleTypeUri)
-
Methods inherited from interface systems.dmx.core.DMXObject
checkWriteAccess, delete, getAssoc, getAssocs, getChildTopics, getDatabaseVendorObject, getId, getProperty, getRelatedAssoc, getRelatedAssocs, getRelatedAssocs, getRelatedTopic, getRelatedTopics, getRelatedTopics, getSimpleValue, getType, getTypeUri, getUri, hasProperty, loadChildTopics, loadChildTopics, removeProperty, setProperty, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setTypeUri, setUri, update, update, updateChildTopics
-
Methods inherited from interface systems.dmx.core.JSONEnabled
dump, toJSON
-
-
-
-
Method Detail
-
getPlayer1
Player getPlayer1()
-
getPlayer2
Player getPlayer2()
-
getDMXObject1
DMXObject getDMXObject1()
-
getDMXObject2
DMXObject getDMXObject2()
-
getDMXObjectByRole
<O extends RelatedObject> O getDMXObjectByRole(String roleTypeUri)
TODO: rename method to "getPlayerObjectByRole"- Returns:
- this association's player which plays the given role.
If there is no such player, null is returned. ### FIXDOC
If there are 2 such players an exception is thrown.
-
getDMXObjectByType
<O extends RelatedObject> O getDMXObjectByType(String topicTypeUri)
TODO: rename method to "getPlayerObjectByType"- Returns:
- this association's topic which has the given type.
If there is no such topic, null is returned. ### FIXDOC
If there are 2 such topics an exception is thrown.
-
getPlayerByRole
Player getPlayerByRole(String roleTypeUri)
- Returns:
- this association's player that plays the given role. If no player matches, null is returned. If both players are matching an exception is thrown.
-
playerCount
int playerCount(String roleTypeUri)
-
hasSameRoleTypeUris
boolean hasSameRoleTypeUris()
-
matches
boolean matches(String roleTypeUri1, long playerId1, String roleTypeUri2, long playerId2)
Checks if the given players match this association. The given role type URIs must be different. The player position ("1" vs. "2") is not relevant.- Returns:
- true if the given players match this association.
- Throws:
IllegalArgumentException
- if both given role type URIs are identical.
-
getOtherPlayerId
long getOtherPlayerId(long id)
-
getModel
AssocModel getModel()
-
-