freemarker.template.utility
Class OptimizerUtil

java.lang.Object
  extended by freemarker.template.utility.OptimizerUtil

public class OptimizerUtil
extends java.lang.Object

Version:
$Id: OptimizerUtil.java,v 1.9 2003/02/25 11:52:58 szegedia Exp $
Author:
Attila Szegedi

Method Summary
static java.util.List optimizeListStorage(java.util.List list)
           
static java.lang.Number optimizeNumberRepresentation(java.lang.Number number)
          This is needed to reverse the extreme conversions in arithmetic operations so that numbers can be meaningfully used with models that don't know what to do with a BigDecimal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

optimizeListStorage

public static java.util.List optimizeListStorage(java.util.List list)

optimizeNumberRepresentation

public static java.lang.Number optimizeNumberRepresentation(java.lang.Number number)
This is needed to reverse the extreme conversions in arithmetic operations so that numbers can be meaningfully used with models that don't know what to do with a BigDecimal. Of course, this will make impossible for these models (i.e. Jython) to receive a BigDecimal even if it was originally placed as such in the data model. However, since arithmetic operations aggressively erase the information regarding the original number type, we have no other choice to ensure expected operation in majority of cases.