|
|||||||||||
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.TM4JTopicWrapper de.uka.ipd.consensus.impl.TopicImpl
TODO
Field Summary |
Fields inherited from class de.uka.ipd.consensus.impl.TM4JObjectWrapper |
EMPTY_SCOPE |
Constructor Summary | |
protected |
TopicImpl(OntologyManagerImpl omi,
org.tm4j.topicmap.Topic tmTopic)
|
Method Summary | |
void |
addAttribute(User setter,
Attribute attr)
Adds an attribute object to the attributeable element. |
Occurrence |
addOccurrence(User adder,
String data,
Topic type)
Creates an occurrence for this topic with the given type and value (data). |
Rating |
addRating(User rater,
double value)
Adds a rating for the given user to this element. |
SuperSubclass |
addSuperclass(User adder,
Topic cls)
Adds a superclass to this topic. |
Synonym |
addSynonym(User adder,
Topic topic)
Adds another topic as a synonym to this topic (and vice versa). |
TypeInstance |
addType(User adder,
Topic type)
Adds a type to this topic. |
Collection |
getAssociations(User user)
Returns a collection of Association objects in which this topic plays a role. |
Attribute |
getAttribute(User getter,
String id)
Returns the attribute of a given id. |
Collection |
getAttributes(User getter)
Returns a collection of all Attribute objects of this element that the user may see. |
Collection |
getAttributes(User getter,
Topic type)
Returns a collection of all Attribute objects of the given type. |
double |
getAverageRatingValue()
Returns the average value (the arithmetic mean) of all current ratings for this element. |
Collection |
getInstances(User user)
Returns a collection of TypeInstance objects containing the instances of this type (class) topic. |
Occurrence |
getOccurrence(User user,
String id)
Queries an occurrence of this topic with the given id. |
Collection |
getOccurrences(Topic type)
Returns a collection of all Occurrence objects of a certain type for this topic. |
Collection |
getOccurrences(User user)
Returns a collection of all Occurrence objects for this topic. |
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 |
getSubclasses(User user)
Returns a collection of SuperSubclass objects containing the subclasses of this class topic. |
SuperSubclass |
getSuperclass(User user,
String id)
Queries a superclass of this topic with the given id. |
Collection |
getSuperclasses(User user)
Returns a collection of SuperSubclass objects containing the superclasses of this class topic. |
Synonym |
getSynonym(User user,
String id)
Queries a synonym of this topic with the given id. |
Collection |
getSynonyms(User user)
Returns a collection of all Synonym objects for this topic. |
TypeInstance |
getType(User user,
String id)
Queries a type with the given id of this instance topic. |
Collection |
getTypes(User user)
Returns a collection of TypeInstance objects containing the types of this instance topic. |
protected boolean |
hasFlag(String flag)
|
boolean |
isClassTopic()
Checks if this topic is a class topic. |
boolean |
isOfType(Topic type)
Checks if this concept is of the given type. |
boolean |
isSynonymous(Topic topic)
Checks if the given topic is synonymous with this topic. |
void |
removeAttribute(User remover,
Attribute attr)
Removes the given attribute, if the object is an attribute of this element (otherwise, the call is ignored). |
protected void |
removeFlag(String flag)
|
void |
removeOccurrence(User remover,
Occurrence occ)
Removes an occurrence from this topic. |
void |
removeSuperclass(User remover,
Topic cls)
Removes a superclass from this class topic. |
void |
removeSynonym(User remover,
Topic topic)
Removes a synonymous topic from this topic (and vice versa). |
void |
removeType(User remover,
Topic type)
Removes a type from this topic. |
void |
setClassTopic(boolean isclass)
Controls the class flag, i.e. if the topic is a class or an instance topic. |
protected void |
setFlag(String flag)
|
String |
toString()
|
Methods inherited from class de.uka.ipd.consensus.impl.TM4JTopicWrapper |
compareTo, getComment, getCreator, getId, getName, getOccurrence, getVersion, getWrappedTopic, incVersion, setComment, setName |
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 |
Methods inherited from interface de.uka.ipd.consensus.foundation.schema.Concept |
getId, getName, setName |
Methods inherited from interface de.uka.ipd.consensus.foundation.schema.Versionable |
getVersion |
Methods inherited from interface de.uka.ipd.consensus.foundation.schema.Commentatable |
getComment, setComment |
Methods inherited from interface de.uka.ipd.consensus.foundation.schema.Createable |
getCreator |
Methods inherited from interface java.lang.Comparable |
compareTo |
Constructor Detail |
protected TopicImpl(OntologyManagerImpl omi, org.tm4j.topicmap.Topic tmTopic)
Method Detail |
public Collection getInstances(User user)
Topic
getInstances
in interface Topic
user
- the user who wants to see the instances
null
TypeInstance
,
DynamicRightsManager.mayViewTopic(User, Topic)
,
QueryEngine.getInstances(User, Topic)
,
Topic.isClassTopic()
,
Topic.getSubclasses(User)
public Collection getTypes(User user)
Topic
getTypes
in interface Topic
user
- the user who wants to see the types
null
TypeInstance
,
DynamicRightsManager.mayViewTopic(User, Topic)
,
QueryEngine.getTypes(User, Topic)
,
Topic.getSuperclasses(User)
public TypeInstance getType(User user, String id)
Topic
getType
in interface Topic
user
- the user who wants to see the typeid
- the queried id
null
if there's no type with the given idDynamicRightsManager.mayViewTopic(User, Topic)
,
Topic.getSuperclass(User, String)
public TypeInstance addType(User adder, Topic type) throws OntologyManagerException, DynamicRightsManagerException
Topic
addType
in interface Topic
adder
- the user who wants to add the typetype
- the type topic to be added (must not be null
)
OntologyManagerException
- if the type could not be added
DynamicRightsManagerException
- if the user is not allowed to add a typeTopic.isClassTopic()
,
DynamicRightsManager.mayAddType(User, Topic)
,
Topic.addSuperclass(User, Topic)
public void removeType(User remover, Topic type) throws OntologyManagerException, DynamicRightsManagerException
Topic
removeType
in interface Topic
remover
- the user who wants to remove the typetype
- the type to be removed
DynamicRightsManagerException
- if the user is not allowed to remove the type
OntologyManagerException
- if the type could not be removedTypeInstance
,
DynamicRightsManager.mayRemoveType(User, TypeInstance)
,
Topic.removeSuperclass(User, Topic)
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 getAssociations(User user)
Topic
getAssociations
in interface Topic
user
- the user who wants to see the associations
null
Association
,
DynamicRightsManager.mayViewAssociation(User, Association)
,
QueryEngine.getAssociations(User, Topic)
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 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 void addAttribute(User setter, Attribute attr) throws OntologyManagerException, DynamicRightsManagerException
Attributeable
addAttribute
in interface Attributeable
setter
- the user who wants to add the attributeattr
- the Attribute object
DynamicRightsManagerException
- if the user is not allowed to add the attribute
OntologyManagerException
- if the attribute could not be addedOntologyManager.createAttribute(User, String, String, String, Topic)
,
DynamicRightsManager.mayAddAttribute(User, Attribute, Attributeable)
public void removeAttribute(User remover, Attribute attr) throws OntologyManagerException, DynamicRightsManagerException
Attributeable
removeAttribute
in interface Attributeable
remover
- the user who wants to remove the attributeattr
- the Attribute object to be removed
OntologyManagerException
- if the attribute could not be removed
DynamicRightsManagerException
- if the user is not allowed to remove the attributeDynamicRightsManager.mayRemoveAttribute(User, Attribute)
public Attribute getAttribute(User getter, String id)
Attributeable
getAttribute
in interface Attributeable
getter
- the user who wants to get the attributeid
- the id in question
null
if this element does not have an attribute with the idConcept.getId()
,
DynamicRightsManager.mayViewAttribute(User, Attribute)
public Collection getAttributes(User getter)
Attributeable
getAttributes
in interface Attributeable
getter
- the user who wants to see the attributes
null
Attribute
,
DynamicRightsManager.mayViewAttribute(User, Attribute)
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Collection getAttributes(User getter, Topic type)
Attributeable
getAttributes
in interface Attributeable
getter
- the user who wants to see the attributestype
- type the type topic of the attributes, including null
for the typeless attributes
null
Attribute
,
DynamicRightsManager.mayViewAttribute(User, Attribute)
public Collection getOccurrences(User user)
Topic
getOccurrences
in interface Topic
user
- the user who wants to see the occurrences.
null
Occurrence
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Collection getOccurrences(Topic type)
Topic
getOccurrences
in interface Topic
type
- the type of the occurrences
null
Occurrence
public Occurrence getOccurrence(User user, String id)
Topic
getOccurrence
in interface Topic
user
- the user who wants to see the occurrenceid
- the queried id
null
if there's no occurrence with the given id for this topicOccurrence.getId()
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Occurrence addOccurrence(User adder, String data, Topic type) throws OntologyManagerException, DynamicRightsManagerException
Topic
addOccurrence
in interface Topic
adder
- the user who wants to create the occurrencedata
- the value of the occurrence (null
is treated as the empty string)type
- the type of the occurrence, including null
for a typeless occurrence
DynamicRightsManagerException
- if the user is not allowed to create occurrences
OntologyManagerException
- if a new occurrence could not be createdTopic.isClassTopic()
,
DynamicRightsManager.mayChangeOccurrence(User)
public void removeOccurrence(User remover, Occurrence occ) throws OntologyManagerException, DynamicRightsManagerException
Topic
removeOccurrence
in interface Topic
remover
- the user who wants to remove the occurrence.occ
- the occurrence to be removed
OntologyManagerException
- if the occurrence could not be removed
DynamicRightsManagerException
- if the user is not allowed to remove occurrencesDynamicRightsManager.mayChangeOccurrence(User)
public Collection getSynonyms(User user)
Topic
getSynonyms
in interface Topic
user
- the user who wants to see the synonyms
null
Synonym
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Synonym getSynonym(User user, String id)
Topic
getSynonym
in interface Topic
user
- the user who wants to see the synonymid
- the queried id
null
if there's no synonym with the given idDynamicRightsManager.mayViewTopic(User, Topic)
public boolean isSynonymous(Topic topic)
Topic
isSynonymous
in interface Topic
topic
- the topic in question
true
if the two topics are synonymous, false
otherwisepublic Synonym addSynonym(User adder, Topic topic) throws OntologyManagerException, DynamicRightsManagerException
Topic
addSynonym
in interface Topic
adder
- the user who wants to add the synonymtopic
- the synonymous topic to be added (not null
, not this topic itself)
DynamicRightsManagerException
- if the user is not allowed to add synonyms
OntologyManagerException
- if the synonymous topic could not be addedDynamicRightsManager.mayAddSynonym(User, Topic)
public void removeSynonym(User remover, Topic topic) throws OntologyManagerException, DynamicRightsManagerException
Topic
removeSynonym
in interface Topic
remover
- the user who wants to remove the synonymous topictopic
- the synonymous topic to be removed
DynamicRightsManagerException
- if the user is not allowed to remove the synonymous topic
OntologyManagerException
- if the synonymous topic could not be removedSynonym
,
DynamicRightsManager.mayRemoveSynonym(User, Synonym)
protected void setFlag(String flag) throws OntologyManagerException
OntologyManagerException
protected void removeFlag(String flag) throws OntologyManagerException
OntologyManagerException
protected boolean hasFlag(String flag)
public void setClassTopic(boolean isclass) throws OntologyManagerException
Topic
Controls the class flag, i.e. if the topic is a class or an instance topic.
You can use this method explicitely if the implementation is not configured to use classes, but usually you'll let the implementation decide which topics are classes by how the topics are created.
setClassTopic
in interface Topic
isclass
- true
if the topic shall be a class topic, false
if it shall be an instance topic
OntologyManagerException
- if the class flag could not be changedOntologyManager.createClassTopic(User, String, String, Topic)
,
Topic.isClassTopic()
public boolean isClassTopic()
Topic
isClassTopic
in interface Topic
true
if this topic is a class topic, false
otherwiseTopic.setClassTopic(boolean)
public SuperSubclass getSuperclass(User user, String id)
Topic
null
is returned.
getSuperclass
in interface Topic
user
- the user who wants to see the superclassid
- the queried id
null
if there's no superclass with the given idDynamicRightsManager.mayViewTopic(User, Topic)
,
Topic.isClassTopic()
,
Topic.getType(User, String)
public Collection getSuperclasses(User user)
Topic
getSuperclasses
in interface Topic
user
- the user who wants to see the superclasses
null
SuperSubclass
,
DynamicRightsManager.mayViewTopic(User, Topic)
,
QueryEngine.getSuperclasses(User, Topic)
,
Topic.getTypes(User)
public Collection getSubclasses(User user)
Topic
getSubclasses
in interface Topic
user
- the user who wants to see the subclasses
null
SuperSubclass
,
DynamicRightsManager.mayViewTopic(User, Topic)
,
QueryEngine.getSubclasses(User, Topic)
,
Topic.getInstances(User)
public SuperSubclass addSuperclass(User adder, Topic cls) throws OntologyManagerException, DynamicRightsManagerException
Topic
addSuperclass
in interface Topic
adder
- the user who wants to add the superclasscls
- the superclass topic to be added (must not be null
)
OntologyManagerException
- if the superclass could not be added
DynamicRightsManagerException
- if the user is not allowed to add a superclassTopic.isClassTopic()
,
DynamicRightsManager.mayAddClass(User, Topic)
,
Topic.addType(User, Topic)
public void removeSuperclass(User remover, Topic cls) throws OntologyManagerException, DynamicRightsManagerException
Topic
removeSuperclass
in interface Topic
remover
- the user who wants to remove the superclasscls
- the superclass topic to be removed
DynamicRightsManagerException
- if the user is not allowed to remove the superclass
OntologyManagerException
- if the superclass could not be removedTopic.isClassTopic()
,
DynamicRightsManager.mayRemoveClass(User, SuperSubclass)
,
Topic.removeType(User, Topic)
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |