1 |
45968
|
panagiotis
|
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 Browse implements IsSerializable {
|
13 |
|
|
|
14 |
|
|
public enum Category implements IsSerializable {
|
15 |
|
|
SCIENTIFIC_AREA("scientific area"),
|
16 |
|
|
COUNTRY("country"),
|
17 |
|
|
ORGANIZATION("organization"),
|
18 |
|
|
PUBLISHER("publisher"),
|
19 |
|
|
STATUS("status");
|
20 |
|
|
|
21 |
|
|
private String value = this.name();
|
22 |
|
|
|
23 |
|
|
Category() {
|
24 |
|
|
}
|
25 |
|
|
|
26 |
|
|
Category(String value) {
|
27 |
|
|
this.value = value;
|
28 |
|
|
}
|
29 |
|
|
|
30 |
|
|
public String getValue() {
|
31 |
|
|
return value;
|
32 |
|
|
}
|
33 |
|
|
}
|
34 |
|
|
|
35 |
|
|
private Map<Category, List<Triple<String, String, Integer>>> data;
|
36 |
|
|
|
37 |
|
|
public Browse(Map<Category, List<Triple<String, String, Integer>>> data) {
|
38 |
|
|
this.data = data;
|
39 |
|
|
}
|
40 |
|
|
|
41 |
|
|
public Browse() {
|
42 |
|
|
}
|
43 |
|
|
|
44 |
|
|
public List<Triple<String, String, Integer>> getData(Category category) {
|
45 |
|
|
if (data.containsKey(category))
|
46 |
|
|
return new ArrayList<Triple<String, String, Integer>>(data.get(category));
|
47 |
|
|
else
|
48 |
|
|
return new ArrayList<Triple<String, String, Integer>>();
|
49 |
|
|
}
|
50 |
|
|
|
51 |
|
|
public List<Category> getCategories() {
|
52 |
|
|
return new ArrayList<Category>(data.keySet());
|
53 |
|
|
}
|
54 |
|
|
}
|