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
AssocModelcan also be used to provide the data for an association create or update operation. To instantiate anAssocModeluse theModelFactory.- Author:
- Jörg Richter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AssocModelclone()longgetOtherPlayerId(long id)PlayerModelgetPlayer1()PlayerModelgetPlayer2()PlayerModelgetPlayerByRole(String roleTypeUri)booleanhasSameRoleTypeUris()booleanmatches(String roleTypeUri1, long playerId1, String roleTypeUri2, long playerId2)Checks if the given players match this association.intplayerCount(String roleTypeUri)voidsetPlayer1(PlayerModel player1)voidsetPlayer2(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:
clonein interfaceDMXObjectModel
-
-