com.darwinsys.lang
Class MutableInteger
java.lang.Object
com.darwinsys.lang.MutableInteger
public class MutableInteger
- extends java.lang.Object
A MutableInteger is like an Integer but mutable, to avoid the
excess object creation involved in
c = new Integer(c.getInt()+1)
which can get expensive if done a lot.
Not subclassed from Integer, since Integer is final (for performance :-))
- Version:
- $Id: MutableInteger.java,v 1.6 2004/05/24 17:48:38 ian Exp $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MutableInteger
public MutableInteger(int i)
MutableInteger
public MutableInteger()
incr
public int incr()
incr
public int incr(int amt)
decr
public int decr()
setValue
public int setValue(int i)
getValue
public int getValue()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
toString
public static java.lang.String toString(int val)
parseInt
public static int parseInt(java.lang.String str)
Copyright © 1996-2004 Ian F. Darwin. See license.html for usage license.