de.deepamehta.core.model
Class TopicRoleModel

Show UML class diagram
java.lang.Object
  extended by de.deepamehta.core.model.RoleModel
      extended by de.deepamehta.core.model.TopicRoleModel
All Implemented Interfaces:
Cloneable

public class TopicRoleModel
extends RoleModel

The role a topic plays in an association.

A TopicRoleModel object is a pair of a topic reference and a role type reference. The topic is refered to either by its ID or URI. The role type is refered to by its URI.

Assertion: both, the topic reference and the role type reference are set.

In the database a role type is represented by a topic of type "dm4.core.role_type".


Field Summary
private  boolean topicIdentifiedByUri
           
private  String topicUri
           
 
Fields inherited from class de.deepamehta.core.model.RoleModel
playerId, roleTypeUri
 
Constructor Summary
TopicRoleModel(org.codehaus.jettison.json.JSONObject topicRoleModel)
           
TopicRoleModel(long topicId, String roleTypeUri)
           
TopicRoleModel(String topicUri, String roleTypeUri)
           
 
Method Summary
 long getPlayerId()
           
 String getTopicUri()
           
 boolean refsSameObject(RoleModel model)
          Checks weather the given role model refers to the same object as this role model.
 org.codehaus.jettison.json.JSONObject toJSON()
           
 boolean topicIdentifiedByUri()
           
 String toString()
           
 
Methods inherited from class de.deepamehta.core.model.RoleModel
clone, getRoleTypeUri, setPlayerId, setRoleTypeUri
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

topicUri

private String topicUri

topicIdentifiedByUri

private boolean topicIdentifiedByUri
Constructor Detail

TopicRoleModel

public TopicRoleModel(long topicId,
                      String roleTypeUri)

TopicRoleModel

public TopicRoleModel(String topicUri,
                      String roleTypeUri)

TopicRoleModel

public TopicRoleModel(org.codehaus.jettison.json.JSONObject topicRoleModel)
Method Detail

getPlayerId

public long getPlayerId()
Overrides:
getPlayerId in class RoleModel

getTopicUri

public String getTopicUri()

topicIdentifiedByUri

public boolean topicIdentifiedByUri()

refsSameObject

public boolean refsSameObject(RoleModel model)
Description copied from class: RoleModel
Checks weather the given role model refers to the same object as this role model. In case of a topic role model the topic IDs resp. URIs are compared. In case of an association role model the association IDs are compared. Note: the role types are not compared.

Specified by:
refsSameObject in class RoleModel
Returns:
true if the given role model refers to the same object as this role model.

toJSON

public org.codehaus.jettison.json.JSONObject toJSON()
Specified by:
toJSON in class RoleModel

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015. All Rights Reserved.