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 AssocModelclone()PlayerModelcreatePlayerModel(String roleTypeUri)longgetOtherPlayerId(long id)systems.dmx.core.impl.PlayerModelImplgetPlayer1()systems.dmx.core.impl.PlayerModelImplgetPlayer2()systems.dmx.core.impl.PlayerModelImplgetPlayerByRole(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)org.codehaus.jettison.json.JSONObjecttoJSON()- 
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:
 getPlayer1in interfaceAssocModel
 
- 
getPlayer2
public systems.dmx.core.impl.PlayerModelImpl getPlayer2()
- Specified by:
 getPlayer2in interfaceAssocModel
 
- 
setPlayer1
public void setPlayer1(PlayerModel player1)
- Specified by:
 setPlayer1in interfaceAssocModel
 
- 
setPlayer2
public void setPlayer2(PlayerModel player2)
- Specified by:
 setPlayer2in interfaceAssocModel
 
- 
getPlayerByRole
public systems.dmx.core.impl.PlayerModelImpl getPlayerByRole(String roleTypeUri)
- Specified by:
 getPlayerByRolein 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:
 playerCountin interfaceAssocModel
 
- 
hasSameRoleTypeUris
public boolean hasSameRoleTypeUris()
- Specified by:
 hasSameRoleTypeUrisin interfaceAssocModel
 
- 
matches
public boolean matches(String roleTypeUri1, long playerId1, String roleTypeUri2, long playerId2)
Description copied from interface:AssocModelChecks 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:
 matchesin interfaceAssocModel- Returns:
 - true if the given players match this association.
 
 
- 
getOtherPlayerId
public long getOtherPlayerId(long id)
- Specified by:
 getOtherPlayerIdin interfaceAssocModel
 
- 
createPlayerModel
public PlayerModel createPlayerModel(String roleTypeUri)
- Specified by:
 createPlayerModelin interfaceDMXObjectModel- Overrides:
 createPlayerModelin classDMXObjectModelImpl
 
- 
toJSON
public org.codehaus.jettison.json.JSONObject toJSON()
- Specified by:
 toJSONin interfaceJSONEnabled- Overrides:
 toJSONin classDMXObjectModelImpl
 
- 
clone
public AssocModel clone()
- Specified by:
 clonein interfaceAssocModel- Specified by:
 clonein interfaceDMXObjectModel- Overrides:
 clonein classDMXObjectModelImpl
 
 - 
 
 -