KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > projector > Result


1 package org.apache.slide.projector;
2
3 import java.util.HashMap JavaDoc;
4 import java.util.Map JavaDoc;
5
6 import org.apache.slide.projector.descriptor.StateDescriptor;
7 import org.apache.slide.projector.value.Value;
8
9 public class Result {
10     public final static Result OK = new Result(StateDescriptor.OK);
11
12     protected String JavaDoc state;
13     protected Map JavaDoc resultEntries;
14
15     public Result(String JavaDoc state) {
16         this.state = state;
17         resultEntries = new HashMap JavaDoc();
18     }
19
20     public Result(String JavaDoc state, String JavaDoc key, Value resource) {
21         this(state);
22         addResultEntry(key, resource);
23     }
24
25     public Result(String JavaDoc state, Map JavaDoc resultEntries) {
26         this.state = state;
27         this.resultEntries = resultEntries;
28     }
29
30     public void setState(String JavaDoc state) {
31         this.state = state;
32     }
33
34     public String JavaDoc getState() {
35         return state;
36     }
37
38     public Map JavaDoc getResultEntries() {
39         return resultEntries;
40     }
41
42     public void addResultEntry(String JavaDoc key, Value resource) {
43         resultEntries.put(key, resource);
44     }
45 }
Popular Tags