Project

General

Profile

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
		PUBLICATION_TYPE("publication type"),
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<Quadruple<String, Integer, Float, Float>>> data;
36

    
37
	public Series() {
38
	}
39

    
40
	public Series(Map<Category, List<Quadruple<String, Integer, Float, Float>>> data) {
41
		this.data = data;
42
	}
43

    
44
	public List<Quadruple<String, Integer, Float, Float>> getData(Category category) {
45
		if (data.containsKey(category))
46
			return new ArrayList<Quadruple<String, Integer, Float, Float>>(data.get(category));
47
		else
48
			return new ArrayList<Quadruple<String, Integer, Float, Float>>();
49
	}
50

    
51
	public List<Category> getCategories() {
52
		return new ArrayList<Category>(data.keySet());
53
	}
54
}
(18-18/22)