KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > projector > value > MapValue


1 package org.apache.slide.projector.value;
2
3 import java.util.HashMap JavaDoc;
4 import java.util.Map JavaDoc;
5
6 public class MapValue implements Value {
7     private Map JavaDoc map;
8
9     public final static String JavaDoc CONTENT_TYPE = "application/x-java-map";
10
11     public MapValue() {
12         map = new HashMap JavaDoc();
13     }
14     
15     public MapValue(Map JavaDoc map) {
16         this.map = map;
17     }
18
19     public MapValue(String JavaDoc key, Value value) {
20         this();
21         addEntry(key, value);
22     }
23
24     public void addEntry(String JavaDoc key, Value value) {
25         map.put(key, value);
26     }
27     
28     public Map JavaDoc getMap() {
29         return map;
30     }
31
32     public String JavaDoc getContentType() {
33         return CONTENT_TYPE;
34     }
35
36 }
Popular Tags