01: /*
02: * Created on 17.05.2005 for PIROL
03: *
04: * SVN header information:
05: * $Author: javamap $
06: * $Rev: 856 $
07: * $Date: 2007-06-18 21:15:27 -0700 (Mon, 18 Jun 2007) $
08: * $Id: MetaDataMap.java 856 2007-06-19 04:15:27Z javamap $
09: */
10: package de.fho.jump.pirol.utilities.metaData;
11:
12: import java.util.HashMap;
13: import java.util.Map;
14: import java.util.Set;
15:
16: /**
17: * Class to store meta information of various kinds in a map.
18: * By default an object of this class will be added to the properties of a
19: * DataSource (and is hopefully saved, when e.g. the task is saved).
20: *
21: * @author Ole Rahn
22: * <br>
23: * <br>FH Osnabrück - University of Applied Sciences Osnabrück,
24: * <br>Project: PIROL (2005),
25: * <br>Subproject: Daten- und Wissensmanagement
26: *
27: * @version $Rev: 856 $
28: *
29: */
30: public class MetaDataMap {
31:
32: protected HashMap<Object, Object> metaData = new HashMap<Object, Object>();
33:
34: /**
35: * constructor (needs to be parameterless in order for java2xml to be able to load it)
36: */
37: public MetaDataMap() {
38: super ();
39: }
40:
41: /**
42: * Adds a new meta information to the map
43: *@param key the kind of information
44: *@param value the information itself
45: */
46: public void addMetaInformation(Object key, Object value) {
47: this .metaData.put(key, value);
48: }
49:
50: /**
51: * Gets all meta information in one map object
52: *@return all stored meta information
53: */
54: public HashMap getMetaData() {
55: return metaData;
56: }
57:
58: /**
59: * Sets (overwrites) the stored meta information
60: *@param metaData
61: */
62: public void setMetaData(HashMap<Object, Object> metaData) {
63: this .metaData = metaData;
64: }
65:
66: public void clear() {
67: metaData.clear();
68: }
69:
70: public boolean containsKey(Object key) {
71: return metaData.containsKey(key);
72: }
73:
74: public boolean containsValue(Object value) {
75: return metaData.containsValue(value);
76: }
77:
78: public Set keySet() {
79: return metaData.keySet();
80: }
81:
82: public Object remove(Object key) {
83: return metaData.remove(key);
84: }
85:
86: public Object get(String key) {
87: return metaData.get(key);
88: }
89:
90: public void putAll(Map<Object, Object> arg0) {
91: metaData.putAll(arg0);
92: }
93:
94: }
|