1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.ratings.internal; |
21 |
|
|
22 |
|
import org.xwiki.model.reference.DocumentReference; |
23 |
|
import org.xwiki.ratings.AverageRating; |
24 |
|
import org.xwiki.ratings.RatingsException; |
25 |
|
|
26 |
|
|
27 |
|
@version |
28 |
|
@see |
29 |
|
@since |
30 |
|
|
|
|
| 40.9% |
Uncovered Elements: 13 (22) |
Complexity: 10 |
Complexity Density: 0.83 |
|
31 |
|
public class MemoryAverageRating implements AverageRating |
32 |
|
{ |
33 |
|
private DocumentReference documentRef; |
34 |
|
|
35 |
|
private int nbVotes; |
36 |
|
|
37 |
|
private float averageVote; |
38 |
|
|
39 |
|
private String method; |
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
@param |
45 |
|
@param |
46 |
|
@param |
47 |
|
@param |
48 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
49 |
68 |
public MemoryAverageRating(DocumentReference documentRef, int nbVotes, float averageVote, String method)... |
50 |
|
{ |
51 |
68 |
this.documentRef = documentRef; |
52 |
68 |
this.nbVotes = nbVotes; |
53 |
67 |
this.averageVote = averageVote; |
54 |
67 |
this.method = method; |
55 |
|
} |
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
@return |
61 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
62 |
0 |
public DocumentReference getDocumentReference()... |
63 |
|
{ |
64 |
0 |
return documentRef; |
65 |
|
} |
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
@param |
71 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
72 |
0 |
public void setDocumentReference(DocumentReference documentRef)... |
73 |
|
{ |
74 |
0 |
this.documentRef = documentRef; |
75 |
|
} |
76 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
77 |
67 |
@Override... |
78 |
|
public int getNbVotes() |
79 |
|
{ |
80 |
67 |
return nbVotes; |
81 |
|
} |
82 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
83 |
0 |
@Override... |
84 |
|
public void setNbVotes(int nbVotes) |
85 |
|
{ |
86 |
0 |
this.nbVotes = nbVotes; |
87 |
|
} |
88 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
89 |
67 |
@Override... |
90 |
|
public float getAverageVote() |
91 |
|
{ |
92 |
68 |
return averageVote; |
93 |
|
} |
94 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
95 |
0 |
@Override... |
96 |
|
public void setAverageVote(float averageVote) |
97 |
|
{ |
98 |
0 |
this.averageVote = averageVote; |
99 |
|
} |
100 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
101 |
0 |
@Override... |
102 |
|
public String getMethod() |
103 |
|
{ |
104 |
0 |
return method; |
105 |
|
} |
106 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
107 |
0 |
@Override... |
108 |
|
public void setMethod(String method) |
109 |
|
{ |
110 |
0 |
this.method = method; |
111 |
|
} |
112 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
113 |
0 |
@Override... |
114 |
|
public void save() throws RatingsException |
115 |
|
{ |
116 |
|
} |
117 |
|
} |