1 |
45968
|
panagiotis
|
package eu.dnetlib.goldoa.domain.stats;
|
2 |
|
|
|
3 |
|
|
import com.google.gwt.user.client.rpc.IsSerializable;
|
4 |
|
|
|
5 |
|
|
import java.util.Map;
|
6 |
|
|
|
7 |
|
|
/**
|
8 |
|
|
* Created by antleb on 11/17/15.
|
9 |
|
|
*/
|
10 |
|
|
public class Numbers implements IsSerializable {
|
11 |
|
|
|
12 |
|
|
public enum Category implements IsSerializable {
|
13 |
|
|
REQUESTS("requests"),
|
14 |
|
|
PAID_REQUESTS("paid requests"),
|
15 |
|
|
APPROVED_REQUESTS_WITH_DOI("appoved requests with doi"),
|
16 |
|
|
PAID_REQUESTS_WITH_DOI("paid requests with doi"),
|
17 |
|
|
PROJECTS("projects"),
|
18 |
|
|
TOTAL_AMOUNT("total_amount"),
|
19 |
|
|
AVERAGE_AMOUNT("total_amount"),
|
20 |
|
|
AVERAGE_PER_ARTICLE("average per article"),
|
21 |
|
|
AVERAGE_PER_MONOGRAPH("average per monograph"),
|
22 |
|
|
AVERAGE_PER_BOOK_CHAPTER("average per book chapter"),
|
23 |
|
|
PAID_ARTICLE_REQUESTS("paid article requests"),
|
24 |
|
|
PAID_MONOGRAPH_REQUESTS("paid monograph requests"),
|
25 |
|
|
PAID_BOOK_CHAPTER_REQUESTS("paid book chapter requests");
|
26 |
|
|
|
27 |
|
|
private String value = this.name();
|
28 |
|
|
|
29 |
|
|
Category() {
|
30 |
|
|
}
|
31 |
|
|
|
32 |
|
|
Category(String value) {
|
33 |
|
|
this.value = value;
|
34 |
|
|
}
|
35 |
|
|
|
36 |
|
|
public String getValue() {
|
37 |
|
|
return value;
|
38 |
|
|
}
|
39 |
|
|
}
|
40 |
|
|
|
41 |
|
|
private Map<Category, Number> numbers;
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
public Numbers(Map<Category, Number> numbers) {
|
45 |
|
|
this.numbers = numbers;
|
46 |
|
|
}
|
47 |
|
|
|
48 |
|
|
public Number getNumber(Category category) {
|
49 |
|
|
if (numbers.containsKey(category))
|
50 |
|
|
return numbers.get(category);
|
51 |
|
|
else
|
52 |
|
|
return -1;
|
53 |
|
|
}
|
54 |
|
|
|
55 |
|
|
public void setNumbers(Map<Category, Number> numbers) {
|
56 |
|
|
this.numbers = numbers;
|
57 |
|
|
}
|
58 |
|
|
}
|