public class CommentSet extends AbstractSet<Comment>
| Modifier and Type | Field | Description |
|---|---|---|
static int |
MAX_SIZE |
| Constructor | Description |
|---|---|
CommentSet() |
|
CommentSet(File file) |
File must be gzipped.
|
CommentSet(Collection<Comment> coll) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
add(Comment c) |
Max length for strings enforced in Comment.java.
|
void |
clear() |
Actually clears everything, including hidden.
|
double |
getAverageRating() |
|
long |
getLatestCommentTime() |
Is not adjusted if the latest comment wasn't hidden but is then hidden.
|
int |
getMyRating() |
|
int |
getRatingCount() |
|
boolean |
isModified() |
|
Iterator<Comment> |
iterator() |
Will be in reverse-sort order, i.e.
|
boolean |
remove(int id) |
Remove the id as retrieved from Comment.getID().
|
boolean |
remove(Object o) |
Only hides the comment, doesn't really remove it.
|
void |
save(File file) |
File will be gzipped.
|
int |
size() |
May be more than what the iterator returns,
we do additional deduping in the iterator.
|
addAll, contains, containsAll, isEmpty, retainAll, toArray, toArray, toStringequals, hashCode, removeAllparallelStream, removeIf, streamclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, contains, containsAll, isEmpty, retainAll, spliterator, toArray, toArraypublic static final int MAX_SIZE
public CommentSet()
public CommentSet(Collection<Comment> coll)
public CommentSet(File file) throws IOException
IOExceptionpublic void save(File file) throws IOException
IOExceptionpublic boolean add(Comment c)
add in interface Collection<Comment>add in interface Set<Comment>add in class AbstractCollection<Comment>public boolean remove(Object o)
remove in interface Collection<Comment>remove in interface Set<Comment>remove in class AbstractCollection<Comment>public boolean remove(int id)
public long getLatestCommentTime()
public boolean isModified()
public int getMyRating()
public int getRatingCount()
public double getAverageRating()
public void clear()
clear in interface Collection<Comment>clear in interface Set<Comment>clear in class AbstractCollection<Comment>public int size()
size in interface Collection<Comment>size in interface Set<Comment>size in class AbstractCollection<Comment>public Iterator<Comment> iterator()