KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > example > Page


1 package example;
2
3 import java.util.*;
4
5 public class Page {
6     private String JavaDoc template;
7     private String JavaDoc forward;
8     private Map root = new HashMap();
9
10     public String JavaDoc getTemplate() {
11         return template;
12     }
13     
14     public void setTemplate(String JavaDoc template) {
15         forward = null;
16         this.template = template;
17     }
18
19     public void put(String JavaDoc name, Object JavaDoc value) {
20         root.put(name, value);
21     }
22     
23     public void put(String JavaDoc name, int value) {
24         root.put(name, new Integer JavaDoc(value));
25     }
26     
27     public void put(String JavaDoc name, double value) {
28         root.put(name, new Double JavaDoc(value));
29     }
30
31     public void put(String JavaDoc name, boolean value) {
32         root.put(name, new Boolean JavaDoc(value));
33     }
34     
35     public Map getRoot() {
36         return root;
37     }
38     
39     public String JavaDoc getForward() {
40         return forward;
41     }
42
43     public void setForward(String JavaDoc forward) {
44         template = null;
45         this.forward = forward;
46     }
47
48 }
49
Popular Tags