FileDocCategorySizeDatePackage
MutableInteger.javaAPI DocExample937Fri Oct 12 19:47:06 BST 2001com.darwinsys.util

MutableInteger

public class MutableInteger extends 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.3 2001/10/12 22:47:06 ian Exp $

Fields Summary
private int
value
Constructors Summary
public MutableInteger()


	  
	
public MutableInteger(int i)

		value = i;
	
Methods Summary
public voiddecr()

		value--;
	
public intgetValue()

		return value;
	
public voidincr()

		value++;
	
public voidincr(int amt)

		value += amt;
	
public static intparseInt(java.lang.String str)

		return Integer.parseInt(str);
	
public voidsetValue(int i)

		value = i;
	
public java.lang.StringtoString()

		return Integer.toString(value);
	
public static java.lang.StringtoString(int val)

		return Integer.toString(val);