java.lang.Object
org.klomp.snark.web.I2PSnarkServlet.CommentsHeaderResult
- Enclosing class:
I2PSnarkServlet
Snapshot read atomically from a torrent's comment set: the user's own rating, community rating count and average, and an iterator over the existing comments when any exist. Package-visible for testing.
Field Summary
FieldsModifier and TypeFieldDescription(package private) final doubleCommunity average rating, 0d when there are no ratings.Iterator over the existing comments, null when none are saved.(package private) final intThe user's own rating, 0 when unrated or ratings are disabled.(package private) final intNumber of ratings cast by the community, 0 when ratings are disabled.Constructor Summary
ConstructorsConstructorDescriptionCommentsHeaderResult(int myRating) Single-value result for the no-comment-set case.CommentsHeaderResult(int myRating, int ratingCount, double averageRating, Iterator<Comment> iter) Records the rating snapshot read from a torrent's comment set.Method Summary
Field Details
myRating
final int myRatingThe user's own rating, 0 when unrated or ratings are disabled.ratingCount
final int ratingCountNumber of ratings cast by the community, 0 when ratings are disabled.averageRating
final double averageRatingCommunity average rating, 0d when there are no ratings.iter
Constructor Details
CommentsHeaderResult
CommentsHeaderResult(int myRating) Single-value result for the no-comment-set case.- Parameters:
myRating- the user's own rating (0 when none)
CommentsHeaderResult
Records the rating snapshot read from a torrent's comment set.- Parameters:
myRating- the user's own rating, 0 when unrated or ratings are disabledratingCount- number of ratings cast by the communityaverageRating- community average rating, 0d when there are noneiter- iterator over the existing comments, null when none are saved