Project

General

Profile

1 45658 michele.ar
package eu.dnetlib.administration.uis.modules.is;
2 41866 michele.ar
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import com.google.common.collect.Lists;
7
8
public class CollectionDesc implements Comparable<CollectionDesc> {
9
	private String kind;
10
	private int size = 0;
11
	private List<CollectionTypeDesc> types = Lists.newArrayList();
12
13
	public CollectionDesc() {}
14
15
	public CollectionDesc(String kind, List<CollectionTypeDesc> types, int size) {
16
		this.kind = kind;
17
		this.types = types;
18
		this.size = size;
19
	}
20
21
	public CollectionDesc(String kind) {
22
		this(kind, new ArrayList<CollectionTypeDesc>(), 0);
23
	}
24
25
	public String getKind() {
26
		return kind;
27
	}
28
29
	public void setKind(String kind) {
30
		this.kind = kind;
31
	}
32
33
	public List<CollectionTypeDesc> getTypes() {
34
		return types;
35
	}
36
37
	public void setTypes(List<CollectionTypeDesc> types) {
38
		this.types = types;
39
	}
40
41
	public void addType(String type, int n) {
42
		types.add(new CollectionTypeDesc(type, n));
43
		this.size += n;
44
	}
45
46
	public int getSize() {
47
		return size;
48
	}
49
50
	public void setSize(int size) {
51
		this.size = size;
52
	}
53
54
	@Override
55
	public int compareTo(CollectionDesc o) {
56
		return kind.compareTo(o.getKind());
57
	}
58
59
}