Project

General

Profile

1 39997 antonis.le
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 40461 antonis.le
		PUBLISHER("publisher"),
18
		PUBLICATION_TYPE("publication type"),
19
		STATUS("status");
20 39997 antonis.le
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 41053 antonis.le
	private Map<Category, List<Quadruple<String, Integer, Float, Float>>> data;
36 39997 antonis.le
37
	public Series() {
38
	}
39
40 41053 antonis.le
	public Series(Map<Category, List<Quadruple<String, Integer, Float, Float>>> data) {
41 39997 antonis.le
		this.data = data;
42
	}
43
44 41053 antonis.le
	public List<Quadruple<String, Integer, Float, Float>> getData(Category category) {
45 39997 antonis.le
		if (data.containsKey(category))
46 41053 antonis.le
			return new ArrayList<Quadruple<String, Integer, Float, Float>>(data.get(category));
47 39997 antonis.le
		else
48 41053 antonis.le
			return new ArrayList<Quadruple<String, Integer, Float, Float>>();
49 39997 antonis.le
	}
50
51
	public List<Category> getCategories() {
52
		return new ArrayList<Category>(data.keySet());
53
	}
54
}