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