Package org.biojavax
Class SimpleComment
java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojavax.SimpleComment
- All Implemented Interfaces:
Comparable,Changeable,Comment
An implementaion of Comment.
- Since:
- 1.5
- Author:
- Richard Holland, gwaldon
-
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSimpleComment(String comment, int rank) Constructs a new, immutable comment, given some text and a rank. -
Method Summary
Modifier and TypeMethodDescriptionintComments are ordered first by their rank, then by a string comparison of their text values.booleanTwo comments are defined as equal if their text values and rankings are identical.Returns the comment part of this comment.getId()Gets the Hibernate ID.intgetRank()Returns the rank of this comment.inthashCode()protected voidsetComment(String comment) voidSets the Hibernate ID.voidsetRank(int rank) Sets the rank of this comment.toString()Form: "(#rank) comment"Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Constructor Details
-
SimpleComment
Constructs a new, immutable comment, given some text and a rank.- Parameters:
comment- the text of the comment. Cannot be null.rank- the rank of the comment.
-
SimpleComment
protected SimpleComment()
-
-
Method Details
-
setComment
-
getComment
Returns the comment part of this comment.- Specified by:
getCommentin interfaceComment- Returns:
- a comment.
-
setRank
Sets the rank of this comment.- Specified by:
setRankin interfaceComment- Parameters:
rank- the rank to use.- Throws:
ChangeVetoException- if the new rank is unacceptable.
-
getRank
Returns the rank of this comment. -
equals
Two comments are defined as equal if their text values and rankings are identical. -
compareTo
Comments are ordered first by their rank, then by a string comparison of their text values.- Specified by:
compareToin interfaceComparable
-
hashCode
-
toString
Form: "(#rank) comment" -
getId
Gets the Hibernate ID. Should be used with caution.- Returns:
- the Hibernate ID, if using Hibernate.
-
setId
Sets the Hibernate ID. Should be used with caution.- Parameters:
id- the Hibernate ID, if using Hibernate.
-