Project

General

Profile

1
/**
2
 *
3
 */
4
package eu.dnetlib.domain.data;
5

    
6
import java.util.ArrayList;
7
import java.util.HashMap;
8
import java.util.List;
9
import java.util.Map;
10
import java.util.Set;
11

    
12
/**
13
 * @author kiatrop
14
 *
15
 */
16
public class Document {
17

    
18
	private Map<String, List<String>> map = null;
19

    
20
	public Document() {
21
		map = new HashMap<String, List<String>>();
22
	}
23
	
24
	public Document(Map<String, List<String>> map) {
25
		this.map = map;
26
	}
27

    
28
	public Set<String> getFieldNames() {
29
		return map.keySet();
30
	}
31

    
32
	public Map<String, List<String>> getMap() {
33
		return map;
34
	}
35

    
36
	public void setMap(Map<String, List<String>> map) {
37
		this.map = map;
38
	}
39

    
40
	public void addFieldValue(String fieldname, String value) {
41
		List<String> values = map.get(fieldname);
42
		if (values == null) {
43
			values = new ArrayList<String>();
44
			map.put(fieldname, values);
45
		}
46
		values.add(value);
47
	}
48

    
49
	public List<String> getFieldValues(String fieldname) {
50
		return map.get(fieldname);
51
	}
52

    
53
}
(5-5/23)