01: package edu.indiana.lib.osid.base.repository.http;
02:
03: public class SharedProperties implements org.osid.shared.Properties {
04: private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils
05: .getLog(SharedProperties.class);
06:
07: private java.util.Map map = new java.util.HashMap();
08: private org.osid.shared.Type type = new Type("edu.mit", "shared",
09: "empty");
10:
11: public SharedProperties() throws org.osid.shared.SharedException {
12: }
13:
14: public SharedProperties(java.util.Map map, org.osid.shared.Type type)
15: throws org.osid.shared.SharedException {
16: this .map = map;
17: this .type = type;
18: }
19:
20: public org.osid.shared.ObjectIterator getKeys()
21: throws org.osid.shared.SharedException {
22: return new ObjectIterator(new java.util.Vector(this .map
23: .keySet()));
24: }
25:
26: public java.io.Serializable getProperty(java.io.Serializable key)
27: throws org.osid.shared.SharedException {
28: if (this .map.containsKey(key)) {
29: return (java.io.Serializable) this .map.get(key);
30: } else {
31: throw new org.osid.shared.SharedException(
32: org.osid.shared.SharedException.UNKNOWN_KEY);
33: }
34: }
35:
36: public org.osid.shared.Type getType()
37: throws org.osid.shared.SharedException {
38: return this.type;
39: }
40: }
|