com.darwinsys.util
Class MutableInteger
java.lang.Object
|
+--com.darwinsys.util.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 :-))
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
MutableInteger
public MutableInteger()
MutableInteger
public MutableInteger(int i)
incr
public void incr()
decr
public void decr()
setValue
public void 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)