01: package com.calipso.reportgenerator.reportcalculator;
02:
03: import java.io.Serializable;
04: import java.util.HashMap;
05:
06: /**
07: *
08: * User: Breto
09: * Date: 30/09/2005
10: * Time: 18:19:18
11: *
12: */
13: public class SharedBoolean extends SharedData implements Serializable {
14: private Boolean value;
15: static final private HashMap booleans = new HashMap(3);
16:
17: public SharedBoolean(Boolean value) {
18: this .value = value;
19: booleans.put(value, this );
20: }
21:
22: public Object getValue() {
23: return value;
24: }
25:
26: static public SharedBoolean newFrom(Boolean aValue) {
27: Object bool;
28:
29: bool = booleans.get(aValue);
30: if (bool == null) {
31: return new SharedBoolean(aValue);
32: } else {
33: return (SharedBoolean) bool;
34: }
35: }
36:
37: }
|