Class ReusableInteger

java.lang.Object
java.lang.Number
org.web3d.vrml.scripting.ecmascript.builtin.ReusableInteger
All Implemented Interfaces:
Serializable

public class ReusableInteger extends Number
An integer (non-floating point) extension of the Number abstract base class that allows the user to reset the internal value.

A typical issue with the Javascript runtime is that everywhere it uses object values rather than primitives. With a lot of method calling, that leads to a large amount of garbage being generated. As the runtime only really looks for Number instances rather than specific values, whenever we can, we use this class. That allows us to re use the instances rather than creating them and then throwing them away.

Version:
$Revision: 1.2 $
Author:
Justin Couch
See Also: