de.uka.ipd.consensus.impl
Class OccurrenceImpl

java.lang.Object
  extended byde.uka.ipd.consensus.impl.TM4JObjectWrapper
      extended byde.uka.ipd.consensus.impl.OccurrenceImpl
All Implemented Interfaces:
Comparable, Occurrence, Serializable

public class OccurrenceImpl
extends TM4JObjectWrapper
implements Occurrence

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 OccurrenceImpl(OntologyManagerImpl omi, org.tm4j.topicmap.Occurrence tmOccurrence)
           
 
Method Summary
 int compareTo(Object other)
           
 String getData()
          Returns the value of this occurrence.
 String getId()
          Returns the id of the occurrence.
 Topic getTopic()
          Returns the topic that this occurrence belongs to.
 Topic getType()
          Returns the type topic of this occurrence.
protected  org.tm4j.topicmap.Occurrence getWrappedOccurrence()
           
 boolean isOfType(Topic type)
          Checks if this occurrence is of the given type.
 void setData(User setter, String data)
          Changes the value of the occurrence.
 void setType(User setter, Topic type)
          Sets the type of the occurrence.
 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

OccurrenceImpl

protected OccurrenceImpl(OntologyManagerImpl omi,
                         org.tm4j.topicmap.Occurrence tmOccurrence)
Method Detail

getWrappedOccurrence

protected org.tm4j.topicmap.Occurrence getWrappedOccurrence()

getId

public String getId()
Description copied from interface: Occurrence
Returns the id of the occurrence.

Specified by:
getId in interface Occurrence
Returns:
the id of the occurrence that is computed automatically at creation time

getTopic

public Topic getTopic()
Description copied from interface: Occurrence
Returns the topic that this occurrence belongs to.

Specified by:
getTopic in interface Occurrence
Returns:
the Topic object

getData

public String getData()
Description copied from interface: Occurrence
Returns the value of this occurrence. This may be some kind of a comment or a URL of a web resource.

Specified by:
getData in interface Occurrence
Returns:
the value of the occurrence (may be the empty string, never null)

setData

public void setData(User setter,
                    String data)
             throws OntologyManagerException,
                    DynamicRightsManagerException
Description copied from interface: Occurrence
Changes the value of the occurrence.

Specified by:
setData in interface Occurrence
Parameters:
setter - the user who wants to change the value
data - the new value
Throws:
DynamicRightsManagerException - if the user is not allowed to change the value
OntologyManagerException - if the value could not be changed
See Also:
DynamicRightsManager.mayChangeOccurrence(User)

getType

public Topic getType()
Description copied from interface: Occurrence
Returns the type topic of this occurrence.

Specified by:
getType in interface Occurrence
Returns:
the type topic or null if the occurrence does not have a type

setType

public void setType(User setter,
                    Topic type)
             throws OntologyManagerException,
                    DynamicRightsManagerException
Description copied from interface: Occurrence
Sets the type of the occurrence. If the implementation supports classes, the type must be a class topic.

Specified by:
setType in interface Occurrence
Parameters:
setter - the user who wants to set the type
type - the type topic (or null to remove the type)
Throws:
DynamicRightsManagerException - if the user is not allowed to change the type
OntologyManagerException - if the type could not be set
See Also:
Topic.isClassTopic(), DynamicRightsManager.mayChangeOccurrence(User)

isOfType

public boolean isOfType(Topic type)
Description copied from interface: Occurrence
Checks if this occurrence is of the given type.

Specified by:
isOfType in interface Occurrence
Parameters:
type - the type topic, including null for typeless occurrences
Returns:
true if the occurrence is of the specified type, false otherwise

compareTo

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

toString

public String toString()