1
|
package eu.dnetlib.goldoa.domain.stats;
|
2
|
|
3
|
import com.google.gwt.user.client.rpc.IsSerializable;
|
4
|
|
5
|
import java.util.ArrayList;
|
6
|
import java.util.List;
|
7
|
import java.util.Map;
|
8
|
|
9
|
/**
|
10
|
* Created by antleb on 11/17/15.
|
11
|
*/
|
12
|
public class Series implements IsSerializable {
|
13
|
|
14
|
public enum Category implements IsSerializable {
|
15
|
COUNTRY("country"),
|
16
|
ORGANIZATION("organization"),
|
17
|
PUBLISHER("publisher");
|
18
|
|
19
|
private String value = this.name();
|
20
|
|
21
|
Category() {
|
22
|
}
|
23
|
|
24
|
Category(String value) {
|
25
|
this.value = value;
|
26
|
}
|
27
|
|
28
|
public String getValue() {
|
29
|
return value;
|
30
|
}
|
31
|
}
|
32
|
|
33
|
private Map<Category, List<Tuple<String, Integer>>> data;
|
34
|
|
35
|
public Series() {
|
36
|
}
|
37
|
|
38
|
public Series(Map<Category, List<Tuple<String, Integer>>> data) {
|
39
|
this.data = data;
|
40
|
}
|
41
|
|
42
|
public List<Tuple<String, Integer>> getData(Category category) {
|
43
|
if (data.containsKey(category))
|
44
|
return new ArrayList<Tuple<String, Integer>>(data.get(category));
|
45
|
else
|
46
|
return new ArrayList<Tuple<String, Integer>>();
|
47
|
}
|
48
|
|
49
|
public List<Category> getCategories() {
|
50
|
return new ArrayList<Category>(data.keySet());
|
51
|
}
|
52
|
}
|