summaryrefslogtreecommitdiff
path: root/src/lq/Quote.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/lq/Quote.java')
-rw-r--r--src/lq/Quote.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lq/Quote.java b/src/lq/Quote.java
index b0595b7..8edefaa 100644
--- a/src/lq/Quote.java
+++ b/src/lq/Quote.java
@@ -51,6 +51,14 @@ public class Quote {
this.timestamp = new Date();
}
+ public Double getScore() {
+ Double score = 0.0;
+ for (Vote vote : getVotes()) {
+ score = score + vote.getRating() / getVotes().size();
+ }
+ return score;
+ }
+
public Key getKey() { return key; }
public Long getId() { return id; }
public Date getTimestamp() { return timestamp; }