|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.uka.ipd.consensus.impl.TM4JObjectWrapper de.uka.ipd.consensus.impl.AssociationImpl
This is the TM4J-based implementation of the Association interface.
Field Summary |
Fields inherited from class de.uka.ipd.consensus.impl.TM4JObjectWrapper |
EMPTY_SCOPE |
Constructor Summary | |
protected |
AssociationImpl(OntologyManagerImpl omi,
org.tm4j.topicmap.Association tmAssociation)
|
Method Summary | |
AssociationRole |
addAssociationRole(User adder,
Topic type)
Creates an association role of the given type if the role does not exist yet. |
Rating |
addRating(User rater,
double value)
Adds a rating for the given user to this element. |
void |
addTopic(User adder,
Topic topic,
Topic roleType)
Adds a topic to this association as a player of the given role. |
int |
compareTo(Object other)
|
AssociationRole |
getAssociationRole(Topic type)
Returns the AssociationRole of a certain type. |
Collection |
getAssociationRoles(User getter)
Returns a collection of all AssociationRole objects used by this association. |
double |
getAverageRatingValue()
Returns the average value (the arithmetic mean) of all current ratings for this element. |
String |
getComment()
Returns the comment of the element. |
User |
getCreator()
Returns the user that created this element. |
String |
getId()
Returns the concept's unique id that was either computed automatically or given explicitely at creation time. |
String |
getName()
Returns the concept's name. |
Rating |
getRating(User user)
Returns the rating of the given user for this element. |
Collection |
getRatings()
Returns a collection of all current Rating objects (from different users) for this element. |
int |
getRatingsCount()
Returns the number of ratings for this element. |
Collection |
getTopics(User getter,
Topic roleType)
Returns a collection of Topic player objects of the given role. |
Topic |
getType()
Returns the type of the association. |
Version |
getVersion()
Returns the version of the versionable element. |
protected org.tm4j.topicmap.Association |
getWrappedAssociation()
|
boolean |
hasTopic(Topic topic,
Topic roleType)
Queries if the topic is player of the given role in this association. |
boolean |
hasTopic(User user,
Topic topic)
Queries if the topic is player of any role (that the user is allowed to see) in this association. |
protected Version |
incVersion()
|
boolean |
isOfType(Topic type)
Checks if this concept is of the given type. |
void |
removeAssociationRole(User remover,
Topic type)
Removes the association role of the given type. |
void |
removeTopic(User remover,
Topic topic,
Topic roleType)
Removes a topic from the given role if it is player of the role. |
void |
setComment(User setter,
String comment)
Changes the element's comment. |
void |
setName(User setter,
String name)
Changes the concept's name. |
void |
setType(User setter,
Topic type)
Sets the type of the association. |
String |
toString()
|
Methods inherited from class de.uka.ipd.consensus.impl.TM4JObjectWrapper |
equals, getCache, getLoggingManager, getObjectId, getOccurrence, getOntologyManager, getWrappedObject, hashCode, putCache, wrap, wrap, wrap, wrap, wrap, wrap, wrap |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected AssociationImpl(OntologyManagerImpl omi, org.tm4j.topicmap.Association tmAssociation)
Method Detail |
protected org.tm4j.topicmap.Association getWrappedAssociation()
public String getId()
Concept
getId
in interface Concept
null
)OntologyManager.createTopic(User, String, String, Topic)
,
OntologyManager.createAssociation(User, String, String, Topic)
,
OntologyManager.createAttribute(User, String, String, String, Topic)
public Topic getType()
Association
getType
in interface Association
null
if the association does not have a typepublic void setType(User setter, Topic type) throws OntologyManagerException, DynamicRightsManagerException
Association
setType
in interface Association
setter
- the user who wants to set the typetype
- the type topic (or null
to remove the type)
OntologyManagerException
- if the type could not be set
DynamicRightsManagerException
- if the user is not allowed to change the typeTopic.isClassTopic()
,
DynamicRightsManager.mayChangeAssociation(User, Association)
public boolean isOfType(Topic type)
Concept
isOfType
in interface Concept
type
- the type topic, including null
for typeless concepts
true
if the concept is of the specified type, false
otherwisepublic Collection getAssociationRoles(User getter)
Association
getAssociationRoles
in interface Association
getter
- the user who wants to see the roles
null
AssociationRole
,
DynamicRightsManager.mayViewTopic(User, Topic)
public AssociationRole getAssociationRole(Topic type)
Association
getAssociationRole
in interface Association
type
- the type topic of the desired role, null
for the typeless role
null
if this association does not contain a player topic of the typepublic AssociationRole addAssociationRole(User adder, Topic type) throws OntologyManagerException, DynamicRightsManagerException
Association
addAssociationRole
in interface Association
adder
- the user who wants to add the roletype
- the type topic of the role to be created, including null
for the typeless role
null
DynamicRightsManagerException
- if the user is not allowed to add the role
OntologyManagerException
- if the role could not be createdDynamicRightsManager.mayChangeAssociation(User, Association)
public void removeAssociationRole(User remover, Topic type) throws OntologyManagerException, DynamicRightsManagerException
Association
removeAssociationRole
in interface Association
remover
- the user who wants to remove the roletype
- the type of the role to be removed, including null
for the typeless role
DynamicRightsManagerException
- if the user is not allowed to remove the role
OntologyManagerException
- if the role could not be removedDynamicRightsManager.mayChangeAssociation(User, Association)
public void removeTopic(User remover, Topic topic, Topic roleType) throws OntologyManagerException, DynamicRightsManagerException
Association
removeTopic
in interface Association
remover
- the user who wants to remove the topictopic
- the topic to be removedroleType
- the role that the topic to be removed plays, including null
for the typeless role
DynamicRightsManagerException
- if the user is not allowed to remove the topic
OntologyManagerException
- if the topic could not be removedAssociationRole.removeTopic(User, Topic)
,
DynamicRightsManager.mayChangeAssociation(User, Association)
public void addTopic(User adder, Topic topic, Topic roleType) throws OntologyManagerException, DynamicRightsManagerException
Association
addTopic
in interface Association
adder
- the user who wants to add the topictopic
- the topic to be added to this associationroleType
- the player role of the topic, including null
for the typeless role
OntologyManagerException
- if the topic could not be added
DynamicRightsManagerException
- if the user is not allowed to add the topicAssociationRole.addTopic(User, Topic)
,
DynamicRightsManager.mayChangeAssociation(User, Association)
public boolean hasTopic(Topic topic, Topic roleType)
Association
hasTopic
in interface Association
topic
- the queried topicroleType
- the role that this topic must play, including null
for the typeless role
true
if the topic is player of the given role in this association, false
otherwiseAssociationRole.hasTopic(Topic)
public boolean hasTopic(User user, Topic topic)
Association
hasTopic
in interface Association
user
- the user who does the querytopic
- the queried topic
true
if the topic is player of any role in this association, false
otherwiseDynamicRightsManager.mayViewTopic(User, Topic)
,
AssociationRole.hasTopic(Topic)
public Collection getTopics(User getter, Topic roleType)
Association
getTopics
in interface Association
getter
- the user who wants to see the topicsroleType
- the role type, ncluding null
for the typeless role
null
DynamicRightsManager.mayViewTopic(User, Topic)
,
AssociationRole.getTopics(User)
public String getName()
Concept
getName
in interface Concept
null
)public void setName(User setter, String name) throws OntologyManagerException, DynamicRightsManagerException
Concept
setName
in interface Concept
setter
- the user who wants to change the namename
- the new name
DynamicRightsManagerException
- if the user is not allowed to change the name
OntologyManagerException
- if the name could not be changedprotected Version incVersion()
public Version getVersion()
Versionable
getVersion
in interface Versionable
null
if no version information is availablepublic String getComment()
Commentatable
getComment
in interface Commentatable
null
)public void setComment(User setter, String comment) throws OntologyManagerException, DynamicRightsManagerException
Commentatable
setComment
in interface Commentatable
setter
- the user who wants to change the commentcomment
- the new comment (null
is treated as an empty string)
DynamicRightsManagerException
- if the user is not allowed to change the comment
OntologyManagerException
- if the comment could not be changedDynamicRightsManager.mayChangeConceptComment(User, Concept)
,
DynamicRightsManager.mayChangeUserComment(User, User)
public Collection getRatings()
Rateable
getRatings()
methods of RatingManager
.
getRatings
in interface Rateable
null
Rating
,
RatingManager
public double getAverageRatingValue()
Rateable
getAverageRatingValue
in interface Rateable
public int getRatingsCount()
Rateable
getRatingsCount
in interface Rateable
public Rating getRating(User user)
Rateable
getRatings()
methods of RatingManager
.
getRating
in interface Rateable
user
- the user who's rating shall be returned
null
if the user hasn't rated this element yetRatingManager
public Rating addRating(User rater, double value) throws RatingManagerException, DynamicRightsManagerException
Rateable
RatingManager
methods.
addRating
in interface Rateable
rater
- the user who wants to add or change the ratingvalue
- the new value
DynamicRightsManagerException
- if the user is not allowed to rate this element
RatingManagerException
- if the rating could not be created/changedRatingManager
,
DynamicRightsManager.mayAddRating(Rating, Rateable)
public User getCreator()
Createable
getCreator
in interface Createable
public int compareTo(Object other)
compareTo
in interface Comparable
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |