1 28 package net.sf.jasperreports.engine.fill; 29 30 import java.io.Serializable ; 31 import java.util.HashMap ; 32 import java.util.HashSet ; 33 import java.util.Map ; 34 import java.util.Set ; 35 36 43 public class JRRecordedValues implements Serializable 44 { 45 private Set evaluationTimes; 46 private Map recordedVariableValues; 47 private Map recordedFieldValues; 48 49 54 public JRRecordedValues(Set evaluationTimes) 55 { 56 this.evaluationTimes = new HashSet (evaluationTimes); 57 } 58 59 60 65 public void doneEvaluation(JREvaluationTime evaluationTime) 66 { 67 evaluationTimes.remove(evaluationTime); 68 } 69 70 71 76 public boolean lastEvaluationTime() 77 { 78 return evaluationTimes.size() == 1; 79 } 80 81 82 87 public boolean finishedEvaluations() 88 { 89 return evaluationTimes.isEmpty(); 90 } 91 92 93 99 public void recordVariableValue(String variableName, Object value) 100 { 101 if (recordedVariableValues == null) 102 { 103 recordedVariableValues = new HashMap (); 104 } 105 recordedVariableValues.put(variableName, value); 106 } 107 108 109 115 public void recordFieldValue(String fieldName, Object value) 116 { 117 if (recordedFieldValues == null) 118 { 119 recordedFieldValues = new HashMap (); 120 } 121 recordedFieldValues.put(fieldName, value); 122 } 123 124 125 130 public Map getRecordedVariableValues() 131 { 132 return recordedVariableValues; 133 } 134 135 136 141 public Map getRecordedFieldValues() 142 { 143 return recordedFieldValues; 144 } 145 } 146 | Popular Tags |