de.uka.ipd.consensus.impl
Class TM4JTopicWrapper

java.lang.Object
  extended byde.uka.ipd.consensus.impl.TM4JObjectWrapper
      extended byde.uka.ipd.consensus.impl.TM4JTopicWrapper
All Implemented Interfaces:
Commentatable, Comparable, Concept, Createable, Rateable, Serializable, Versionable
Direct Known Subclasses:
AttributeImpl, TopicImpl

public abstract class TM4JTopicWrapper
extends TM4JObjectWrapper
implements Concept

TODO

Version:
2006-06-14
Author:
Thomas Much
See Also:
Serialized Form

Field Summary
 
Fields inherited from class de.uka.ipd.consensus.impl.TM4JObjectWrapper
EMPTY_SCOPE
 
Constructor Summary
protected TM4JTopicWrapper(OntologyManagerImpl omi, org.tm4j.topicmap.Topic tmTopic)
           
 
Method Summary
 int compareTo(Object other)
           
 String getComment()
          must not return null
 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()
          must not return null
protected  org.tm4j.topicmap.Occurrence getOccurrence(org.tm4j.topicmap.Topic tmType)
           
 Version getVersion()
          Returns the version of the versionable element.
protected  org.tm4j.topicmap.Topic getWrappedTopic()
           
protected  Version incVersion()
           
 void setComment(User setter, String comment)
          Changes the element's comment.
 void setName(User setter, String name)
          Changes the concept's name.
 
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, toString, wait, wait, wait
 
Methods inherited from interface de.uka.ipd.consensus.foundation.schema.Concept
isOfType
 
Methods inherited from interface de.uka.ipd.consensus.foundation.schema.Rateable
addRating, getAverageRatingValue, getRating, getRatings, getRatingsCount
 

Constructor Detail

TM4JTopicWrapper

protected TM4JTopicWrapper(OntologyManagerImpl omi,
                           org.tm4j.topicmap.Topic tmTopic)
Method Detail

getWrappedTopic

protected org.tm4j.topicmap.Topic getWrappedTopic()

getId

public String getId()
Description copied from interface: Concept
Returns the concept's unique id that was either computed automatically or given explicitely at creation time.

Specified by:
getId in interface Concept
Returns:
the id (never empty, never null)
See Also:
OntologyManager.createTopic(User, String, String, Topic), OntologyManager.createAssociation(User, String, String, Topic), OntologyManager.createAttribute(User, String, String, String, Topic)

getCreator

public User getCreator()
Description copied from interface: Createable
Returns the user that created this element.

Specified by:
getCreator in interface Createable
Returns:
the User object

getName

public String getName()
must not return null

Specified by:
getName in interface Concept
Returns:
the name of the concept (may be the empty string, but never null)

setName

public void setName(User setter,
                    String name)
             throws OntologyManagerException,
                    DynamicRightsManagerException
Description copied from interface: Concept
Changes the concept's name.

Specified by:
setName in interface Concept
Parameters:
setter - the user who wants to change the name
name - the new name
Throws:
DynamicRightsManagerException - if the user is not allowed to change the name
OntologyManagerException - if the name could not be changed

getOccurrence

protected org.tm4j.topicmap.Occurrence getOccurrence(org.tm4j.topicmap.Topic tmType)

getComment

public String getComment()
must not return null

Specified by:
getComment in interface Commentatable
Returns:
the comment (may be the empty string, but never null)

setComment

public void setComment(User setter,
                       String comment)
                throws OntologyManagerException,
                       DynamicRightsManagerException
Description copied from interface: Commentatable
Changes the element's comment.

Specified by:
setComment in interface Commentatable
Parameters:
setter - the user who wants to change the comment
comment - the new comment (null is treated as an empty string)
Throws:
DynamicRightsManagerException - if the user is not allowed to change the comment
OntologyManagerException - if the comment could not be changed
See Also:
DynamicRightsManager.mayChangeConceptComment(User, Concept), DynamicRightsManager.mayChangeUserComment(User, User)

incVersion

protected Version incVersion()

getVersion

public Version getVersion()
Description copied from interface: Versionable
Returns the version of the versionable element.

Specified by:
getVersion in interface Versionable
Returns:
the Version object or null if no version information is available

compareTo

public int compareTo(Object other)
Specified by:
compareTo in interface Comparable