de.fu_berlin.ties.util
Class MutableInt

java.lang.Object
  extended by de.fu_berlin.ties.util.MutableInt

public class MutableInt
extends Object

Small wrapper class for an int whose value can be changed. Can be used whenever a mutable object is required, e.g. for adjustable status codes (Integer is immutable, int is a primitive).

Version:
$Revision: 1.1 $, $Date: 2004/02/19 18:16:25 $, $Author: siefkes $
Author:
Christian Siefkes

Constructor Summary
MutableInt()
          Creates a new instance, setting the initial value to 0.
MutableInt(int initialValue)
          Creates a new instance.
 
Method Summary
 int getValue()
          Returns the wrapped int value.
 void setValue(int i)
          Modifies the wrapped int value.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MutableInt

public MutableInt()
Creates a new instance, setting the initial value to 0.


MutableInt

public MutableInt(int initialValue)
Creates a new instance.

Parameters:
initialValue - the initial value to wrap
Method Detail

getValue

public int getValue()
Returns the wrapped int value.

Returns:
the current value

setValue

public void setValue(int i)
Modifies the wrapped int value.

Parameters:
i - the new value

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class Object
Returns:
a textual representation


Copyright © 2003-2004 Christian Siefkes. All Rights Reserved.