Package systems.dmx.core.impl
Class AssocModelImpl
- java.lang.Object
-
- systems.dmx.core.impl.DMXObjectModelImpl
-
- systems.dmx.core.impl.AssocModelImpl
-
- All Implemented Interfaces:
Cloneable
,Identifiable
,JSONEnabled
,AssocModel
,DMXObjectModel
- Direct Known Subclasses:
RelatedAssocModelImpl
public class AssocModelImpl extends DMXObjectModelImpl implements AssocModel
Data that underly anAssoc
.- Author:
- Jörg Richter
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AssocModel
clone()
PlayerModel
createPlayerModel(String roleTypeUri)
long
getOtherPlayerId(long id)
systems.dmx.core.impl.PlayerModelImpl
getPlayer1()
systems.dmx.core.impl.PlayerModelImpl
getPlayer2()
systems.dmx.core.impl.PlayerModelImpl
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)
org.codehaus.jettison.json.JSONObject
toJSON()
-
Methods inherited from class systems.dmx.core.impl.DMXObjectModelImpl
equals, getChildTopics, getId, getSimpleValue, getTypeUri, getUri, hashCode, set, setChildTopics, setId, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setTypeUri, setUri, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface systems.dmx.core.model.DMXObjectModel
getChildTopics, getId, getSimpleValue, getTypeUri, getUri, set, setChildTopics, setId, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setTypeUri, setUri
-
Methods inherited from interface systems.dmx.core.JSONEnabled
dump
-
-
-
-
Method Detail
-
getPlayer1
public systems.dmx.core.impl.PlayerModelImpl getPlayer1()
- Specified by:
getPlayer1
in interfaceAssocModel
-
getPlayer2
public systems.dmx.core.impl.PlayerModelImpl getPlayer2()
- Specified by:
getPlayer2
in interfaceAssocModel
-
setPlayer1
public void setPlayer1(PlayerModel player1)
- Specified by:
setPlayer1
in interfaceAssocModel
-
setPlayer2
public void setPlayer2(PlayerModel player2)
- Specified by:
setPlayer2
in interfaceAssocModel
-
getPlayerByRole
public systems.dmx.core.impl.PlayerModelImpl getPlayerByRole(String roleTypeUri)
- Specified by:
getPlayerByRole
in interfaceAssocModel
- 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
public int playerCount(String roleTypeUri)
- Specified by:
playerCount
in interfaceAssocModel
-
hasSameRoleTypeUris
public boolean hasSameRoleTypeUris()
- Specified by:
hasSameRoleTypeUris
in interfaceAssocModel
-
matches
public boolean matches(String roleTypeUri1, long playerId1, String roleTypeUri2, long playerId2)
Description copied from interface:AssocModel
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.- Specified by:
matches
in interfaceAssocModel
- Returns:
- true if the given players match this association.
-
getOtherPlayerId
public long getOtherPlayerId(long id)
- Specified by:
getOtherPlayerId
in interfaceAssocModel
-
createPlayerModel
public PlayerModel createPlayerModel(String roleTypeUri)
- Specified by:
createPlayerModel
in interfaceDMXObjectModel
- Overrides:
createPlayerModel
in classDMXObjectModelImpl
-
toJSON
public org.codehaus.jettison.json.JSONObject toJSON()
- Specified by:
toJSON
in interfaceJSONEnabled
- Overrides:
toJSON
in classDMXObjectModelImpl
-
clone
public AssocModel clone()
- Specified by:
clone
in interfaceAssocModel
- Specified by:
clone
in interfaceDMXObjectModel
- Overrides:
clone
in classDMXObjectModelImpl
-
-