public class Comment extends Object implements Comparable<Comment>
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_NAME_LEN |
| Constructor and Description |
|---|
Comment(String text,
String name,
int rating)
My comment, now
|
Comment(String text,
String name,
int rating,
long time,
boolean isMine) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Comment c)
reverse
|
boolean |
equals(Object o)
Comments within 10 minutes (not necessarily in same bucket) and otherwise equal are
considered equal.
|
boolean |
equalsIgnoreTimestamp(Comment c)
Ignores timestamp
|
static Comment |
fromPersistentString(String s) |
int |
getID()
A unique ID that may be used to delete this comment from the CommentSet via remove(int).
|
String |
getName() |
int |
getRating() |
String |
getText() |
long |
getTime()
java time (ms)
|
int |
hashCode() |
boolean |
isHidden() |
boolean |
isMine() |
(package private) void |
setHidden() |
String |
toPersistentString() |
public static final int MAX_NAME_LEN
public Comment(String text, String name, int rating)
text - may be null, will be truncated to max length, newlines replaced with spacesname - may be null, will be truncated to max length, newlines and commas removedrating - 0-5public int compareTo(Comment c)
compareTo in interface Comparable<Comment>public boolean equals(Object o)
public boolean equalsIgnoreTimestamp(Comment c)
c - non-nullpublic static Comment fromPersistentString(String s)
public int getID()
public String getName()
public int getRating()
public String getText()
public long getTime()
public boolean isHidden()
public boolean isMine()
void setHidden()
public String toPersistentString()