Package systems.dmx.core.model
Interface AssocModel
-
- All Superinterfaces:
Cloneable
,DMXObjectModel
,Identifiable
,JSONEnabled
- All Known Subinterfaces:
CompDefModel
,RelatedAssocModel
,ViewAssoc
- All Known Implementing Classes:
AssocModelImpl
,RelatedAssocModelImpl
public interface AssocModel extends DMXObjectModel
The data that underly anAssoc
.An
AssocModel
can also be used to provide the data for an association create or update operation. To instantiate anAssocModel
use theModelFactory
.- Author:
- Jörg Richter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AssocModel
clone()
long
getOtherPlayerId(long id)
PlayerModel
getPlayer1()
PlayerModel
getPlayer2()
PlayerModel
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)
void
setPlayer1(PlayerModel player1)
void
setPlayer2(PlayerModel player2)
-
Methods inherited from interface systems.dmx.core.model.DMXObjectModel
createPlayerModel, getChildTopics, getId, getSimpleValue, getTypeUri, getUri, set, setChildTopics, setId, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setTypeUri, setUri
-
Methods inherited from interface systems.dmx.core.JSONEnabled
dump, toJSON
-
-
-
-
Method Detail
-
getPlayer1
PlayerModel getPlayer1()
-
getPlayer2
PlayerModel getPlayer2()
-
setPlayer1
void setPlayer1(PlayerModel player1)
-
setPlayer2
void setPlayer2(PlayerModel player2)
-
getPlayerByRole
PlayerModel 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)
-
clone
AssocModel clone()
- Specified by:
clone
in interfaceDMXObjectModel
-
-