Using Calculated Values

This is an old revision of the document!

Bean bean = new Bean();
bean.put("AMOUNT", BigDecimal.valueOf(11.5));
bean.put("PRICE", BigDecimal.valueOf(15.44));
bean.put("CALCULATED", new ICalculatedValue() 
	public Object getValue(String pName, INode pNode) 
		return ((BigDecimal)pNode.get("AMOUNT")).multiply((BigDecimal)pNode.get("PRICE"));
BeanNode node = new BeanNode(bean);
RtfWorker w = new RtfWorker();
w.saveDocument(new FileOutputStream(getTempOutputFile("result_calculatedValues.rtf")));
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information