public class CommentSet extends AbstractSet<Comment>
Modifier and Type | Field and Description |
---|---|
static int |
MAX_SIZE |
Constructor and Description |
---|
CommentSet() |
CommentSet(Collection<Comment> coll) |
CommentSet(File file)
File must be gzipped.
|
Modifier and Type | Method and 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.
|
equals, hashCode, removeAll
addAll, contains, containsAll, isEmpty, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, contains, containsAll, isEmpty, retainAll, spliterator, toArray, toArray
parallelStream, removeIf, stream
public static final int MAX_SIZE
public CommentSet()
public CommentSet(Collection<Comment> coll)
public CommentSet(File file) throws IOException
IOException
public void save(File file) throws IOException
IOException
public 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()