/** * Return a completly separated copy of this function. The copy does no longer share any * changeable objects with the original function. * * @return a copy of this function. */ public Expression getInstance() { final IndexDataGeneratorFunction instance = (IndexDataGeneratorFunction) super.getInstance(); instance.model = new TypedTableModel(); instance.pageFunction = (PageFunction) pageFunction.getInstance(); instance.dataFormula = (FormulaExpression) dataFormula.getInstance(); instance.dataStorage = new TreeMap<String, IndexDataHolder>(); instance.initialized = false; return instance; }
/** * Clones the expression. The expression should be reinitialized after the cloning. * * <p>Expressions maintain no state, cloning is done at the beginning of the report processing to * disconnect the expression from any other object space. * * @return a clone of this expression. * @throws CloneNotSupportedException this should never happen. */ public Object clone() throws CloneNotSupportedException { final IndexDataGeneratorFunction o = (IndexDataGeneratorFunction) super.clone(); o.dataFormula = (FormulaExpression) dataFormula.clone(); o.pageFunction = (PageFunction) pageFunction.clone(); return o; }