de.unidu.is.annotation.rework.ontology.classes.ServiceObjects
Class Annotation

java.lang.Object
  extended byde.unidu.is.annotation.rework.ontology.classes.ServiceObjects.AnnotableObject
      extended byde.unidu.is.annotation.rework.ontology.classes.ServiceObjects.Annotation
All Implemented Interfaces:
java.lang.Comparable

public class Annotation
extends AnnotableObject
implements java.lang.Comparable

Annotation.java Represents an annotation. See class annotation of the OWL ontology.

Author:
Marc Lechtenfeld

Field Summary
protected  java.util.List annotationTypes
          Annotation types of the annotation
protected  long creationTime
          Creation time
protected  Person creator
          Creator of the annotation
static java.lang.String DEFAULT_ANNOTATION
          Name of the simple annotation class
protected  MVSelection selection
          Selection
protected  AnnotableObject source
          Identifier of the source (e.g. document)
protected  java.util.List targets
          List of targets (AnnotableObjects) of the annotation
protected  java.lang.String text
          Text (content) of the annotation
protected  java.lang.String title
          Title/Subject of the annotation
protected  double weight
          Weight of the annotation (IR)
 
Fields inherited from class de.unidu.is.annotation.rework.ontology.classes.ServiceObjects.AnnotableObject
hasAnnotations, id
 
Constructor Summary
Annotation()
          Creates an empty annotation instance.
Annotation(java.util.List annotationTypes, Person creator, java.lang.String title, AnnotableObject source)
          Creates a new annotation object
 
Method Summary
 int compareTo(java.lang.Object annotation)
          Compares this annotation weight with the weight of the specified annotation.
 void createAnnotationId()
          Creates the Id (creator_timestamp_random) of the annotation.
 java.util.List getAnnotationType()
          Returns the annotation types of the annotation
 java.util.Calendar getCreationTime()
          Returns the creation time of the annotation
 Person getCreator()
          Returns the creator of the annotation
 MVSelection getSelection()
          Returns MVSelection
 AnnotableObject getSource()
          Returns the annotated object
 java.util.List getTargets()
          Returns the targets of the annotation
 java.util.List getTargetUris()
          Returns the URIs of the targets
 java.lang.String getText()
          Returns the text of the annotation
 java.lang.String getTitle()
          Returns the title of the annotation
 double getWeight()
          Returns the weight of the annotation
 void println(java.io.PrintStream out)
          Prints the annotation
 void setAnnotationType(java.util.List annotationTypes)
          Sets the annotation type of the annotation
 void setCreationTime(long milliseconds)
          Sets the creation time of the annotation
 void setCreator(Person creator)
          Sets the creator of the annotation
protected  void setCurrentTime()
          Sets the current time
 void setSelection(MVSelection selection)
          Sets the selection
 void setSource(AnnotableObject source)
          Sets the annotated object
 void setTargets(java.util.List targets)
          Sets the targets of the annotation
 void setTargetUris(java.util.List targetUris)
          Sets the targets of the annotation
 void setText(java.lang.String text)
          Sets the text of the annotation
 void setTitle(java.lang.String title)
          Sets the title of the annotation
 void setWeight(double weight)
          Sets the weight of the annotation
 java.lang.String toString()
          Returns the title of the annotation
 
Methods inherited from class de.unidu.is.annotation.rework.ontology.classes.ServiceObjects.AnnotableObject
getId, getLocalName, hasAnnotations, setHasAnnotation, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_ANNOTATION

public static java.lang.String DEFAULT_ANNOTATION
Name of the simple annotation class


creator

protected Person creator
Creator of the annotation


annotationTypes

protected java.util.List annotationTypes
Annotation types of the annotation


title

protected java.lang.String title
Title/Subject of the annotation


text

protected java.lang.String text
Text (content) of the annotation


source

protected AnnotableObject source
Identifier of the source (e.g. document)


targets

protected java.util.List targets
List of targets (AnnotableObjects) of the annotation


selection

protected MVSelection selection
Selection


creationTime

protected long creationTime
Creation time


weight

protected double weight
Weight of the annotation (IR)

Constructor Detail

Annotation

public Annotation(java.util.List annotationTypes,
                  Person creator,
                  java.lang.String title,
                  AnnotableObject source)
Creates a new annotation object

Parameters:
annotationTypes - Annotation type of the annotation
creator - Creator (user name) of the annotation
title - Title of the annotation
source - Source of the annotation (AnnotableObject)

Annotation

public Annotation()
Creates an empty annotation instance. Only use for annotation pattern.

Method Detail

getCreator

public Person getCreator()
Returns the creator of the annotation

Returns:
Creator of the annotation

setCreator

public void setCreator(Person creator)
Sets the creator of the annotation


getAnnotationType

public java.util.List getAnnotationType()
Returns the annotation types of the annotation


setAnnotationType

public void setAnnotationType(java.util.List annotationTypes)
Sets the annotation type of the annotation

Parameters:
annotationTypes - Annotation type of the annotation

getSource

public AnnotableObject getSource()
Returns the annotated object

Returns:
Annotated object

setSource

public void setSource(AnnotableObject source)
Sets the annotated object

Parameters:
source - Annotated object

getSelection

public MVSelection getSelection()
Returns MVSelection

Returns:
MVSelection instance

setSelection

public void setSelection(MVSelection selection)
Sets the selection

Parameters:
selection - MVSelection

getTargets

public java.util.List getTargets()
Returns the targets of the annotation

Returns:
Targets of the annotation (List of AnnotableObjects)

getTargetUris

public java.util.List getTargetUris()
Returns the URIs of the targets

Returns:
List of URIs of the targets

setTargets

public void setTargets(java.util.List targets)
Sets the targets of the annotation

Parameters:
targets - Targets (AnnotableObjects) of the annotation (

setTargetUris

public void setTargetUris(java.util.List targetUris)
Sets the targets of the annotation

Parameters:
targetUris - URIs of the Targets

getText

public java.lang.String getText()
Returns the text of the annotation

Returns:
Text of the annotation

setText

public void setText(java.lang.String text)
Sets the text of the annotation

Parameters:
text - Text of the annotation

getTitle

public java.lang.String getTitle()
Returns the title of the annotation

Returns:
Title of the annotation

setTitle

public void setTitle(java.lang.String title)
Sets the title of the annotation

Parameters:
title - Title of the annotation

toString

public java.lang.String toString()
Returns the title of the annotation

Overrides:
toString in class AnnotableObject
Returns:
Title of the annotation
See Also:
getLabel()

setWeight

public void setWeight(double weight)
Sets the weight of the annotation

Parameters:
weight - Wight to set

getWeight

public double getWeight()
Returns the weight of the annotation

Returns:
Weight of the annotation

setCurrentTime

protected void setCurrentTime()
Sets the current time


setCreationTime

public void setCreationTime(long milliseconds)
Sets the creation time of the annotation

Parameters:
milliseconds - Time in milliseconds

getCreationTime

public java.util.Calendar getCreationTime()
Returns the creation time of the annotation

Returns:
Creation time

createAnnotationId

public void createAnnotationId()
Creates the Id (creator_timestamp_random) of the annotation.


compareTo

public int compareTo(java.lang.Object annotation)
Compares this annotation weight with the weight of the specified annotation.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
annotation - another annotation
Returns:
-1, 0 or 1

println

public void println(java.io.PrintStream out)
Prints the annotation

Parameters:
out - PrintStream