edu.northwestern.at.wordhoard.model.annotations
Class Annotation

java.lang.Object
  extended by edu.northwestern.at.wordhoard.model.annotations.Annotation
All Implemented Interfaces:
Attachment, PersistentObject
Direct Known Subclasses:
TextAnnotation

public class Annotation
extends java.lang.Object
implements Attachment, PersistentObject

An annotation.

An annotation has the following attributes:


Field Summary
protected  AnnotationCategory category
          The annotation category.
protected  java.lang.Long id
          Unique persistence id (primary key).
protected  TextWrapper text
          The text.
 
Constructor Summary
Annotation()
          Creates a new annotation.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if some other object is equal to this one.
 AnnotationCategory getCategory()
          Gets the annotation category.
 java.lang.Long getId()
          Gets the unique id.
 TextWrapped getText()
          Gets the text.
 int hashCode()
          Returns a hash code for the object.
 void setCategory(AnnotationCategory category)
          Sets the annotation category.
 void setText(TextWrapped text)
          Sets the text.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected java.lang.Long id
Unique persistence id (primary key).


category

protected AnnotationCategory category
The annotation category.


text

protected TextWrapper text
The text.

Constructor Detail

Annotation

public Annotation()
Creates a new annotation.

Method Detail

getId

public java.lang.Long getId()
Gets the unique id.

Specified by:
getId in interface Attachment
Specified by:
getId in interface PersistentObject
Returns:
The unique id.

getCategory

public AnnotationCategory getCategory()
Gets the annotation category.

Specified by:
getCategory in interface Attachment
Returns:
The annotation category.

setCategory

public void setCategory(AnnotationCategory category)
Sets the annotation category.

Specified by:
setCategory in interface Attachment
Parameters:
category - The annotation category.

getText

public TextWrapped getText()
Gets the text.

Specified by:
getText in interface Attachment
Returns:
The text.

setText

public void setText(TextWrapped text)
Sets the text.

Specified by:
setText in interface Attachment
Parameters:
text - The text.

equals

public boolean equals(java.lang.Object obj)
Returns true if some other object is equal to this one.

The two annotations are equal if their ids are equal.

Specified by:
equals in interface Attachment
Overrides:
equals in class java.lang.Object
Parameters:
obj - The other object.
Returns:
True if this object equals the other object.

hashCode

public int hashCode()
Returns a hash code for the object.

Specified by:
hashCode in interface Attachment
Overrides:
hashCode in class java.lang.Object
Returns:
The hash code.