1 package com.calipso.reportgenerator.reportcalculator; 2 3 import java.io.Serializable ; 4 import java.util.HashMap ; 5 6 13 public class SharedBoolean extends SharedData implements Serializable { 14 private Boolean value; 15 static final private HashMap booleans = new HashMap (3); 16 17 18 public SharedBoolean(Boolean value) { 19 this.value = value; 20 booleans.put(value, this); 21 } 22 23 public Object getValue() { 24 return value; 25 } 26 27 static public SharedBoolean newFrom(Boolean aValue) { 28 Object bool; 29 30 bool = booleans.get(aValue); 31 if (bool == null) { 32 return new SharedBoolean(aValue); 33 } 34 else { 35 return (SharedBoolean) bool; 36 } 37 } 38 39 } 40 | Popular Tags |