public class SimpleComment extends AbstractChangeable implements Comment
| Modifier | Constructor and Description |
|---|---|
protected |
SimpleComment() |
|
SimpleComment(java.lang.String comment,
int rank)
Constructs a new, immutable comment, given some text and a rank.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(java.lang.Object o)
Comments are ordered first by their rank, then by a string
comparison of their text values.
|
boolean |
equals(java.lang.Object obj)
Two comments are defined as equal if their text values and
rankings are identical.
|
java.lang.String |
getComment()
Returns the comment part of this comment.
|
java.lang.Integer |
getId()
Gets the Hibernate ID.
|
int |
getRank()
Returns the rank of this comment.
|
int |
hashCode() |
protected void |
setComment(java.lang.String comment) |
void |
setId(java.lang.Integer id)
Sets the Hibernate ID.
|
void |
setRank(int rank)
Sets the rank of this comment.
|
java.lang.String |
toString()
Form: "(#rank) comment"
|
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerpublic SimpleComment(java.lang.String comment,
int rank)
comment - the text of the comment. Cannot be null.rank - the rank of the comment.protected SimpleComment()
protected void setComment(java.lang.String comment)
public java.lang.String getComment()
getComment in interface Commentpublic void setRank(int rank)
throws ChangeVetoException
setRank in interface Commentrank - the rank to use.ChangeVetoException - if the new rank is unacceptable.public int getRank()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparablepublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Integer getId()
public void setId(java.lang.Integer id)
id - the Hibernate ID, if using Hibernate.