1 28 package net.sf.jasperreports.engine.fill; 29 30 import java.util.HashMap ; 31 import java.util.Map ; 32 33 34 42 public class JRFillCloneFactory 43 { 44 private Map cloneMap; 45 46 public JRFillCloneFactory() 47 { 48 cloneMap = new HashMap (); 49 } 50 51 protected JRCloneable getCached(JRCloneable original) 52 { 53 return (JRCloneable) cloneMap.get(original); 54 } 55 56 public void put(JRCloneable original, JRCloneable clone) 57 { 58 cloneMap.put(original, clone); 59 } 60 61 public JRCloneable getClone(JRCloneable original) 62 { 63 JRCloneable clone; 64 65 if (original == null) 66 { 67 clone = null; 68 } 69 else 70 { 71 clone = getCached(original); 72 73 if (clone == null) 74 { 75 clone = original.createClone(this); 76 } 77 } 78 79 return clone; 80 } 81 } 82 | Popular Tags |