IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.patterns.framework.util
Class MutableInteger

java.lang.Object
  extended bycom.ibm.xtools.patterns.framework.util.MutableInteger

public class MutableInteger
extends Object

A mutable integer mainly used for the accumulation of state from local or anonymously defined inner classes into the surrounding context (to be accessed variables of this type must be defined final at point-of-use). A java.lang.Integer is immutable and therefore cannot be used for this purpose.


Constructor Summary
MutableInteger()
          Constructs a mutable integer and intializes the starting value to zero.
MutableInteger(int value)
          Constructs a mutable integer and initializes it to the given value.
 
Method Summary
 int decrement()
          The value of the mutable integer is decreased by one.
 boolean equals(Object object)
           
 int getValue()
          Returns the internally stored value of the mutable integer.
 int hashCode()
           
 int increment()
          The value of the mutable integer increased by one.
 void setValue(int value)
          Sets the value of the mutable integer to the value given.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutableInteger

public MutableInteger()
Constructs a mutable integer and intializes the starting value to zero.


MutableInteger

public MutableInteger(int value)
Constructs a mutable integer and initializes it to the given value.

Parameters:
value - the value to initialize this mutable integer to
Method Detail

decrement

public int decrement()
The value of the mutable integer is decreased by one.

Returns:
the value after the mutable integer has been decremented by one

equals

public boolean equals(Object object)

getValue

public int getValue()
Returns the internally stored value of the mutable integer.

Returns:
the current value of the mutable integer

hashCode

public int hashCode()

increment

public int increment()
The value of the mutable integer increased by one.

Returns:
the value after the mutable integer has been incremented by one

setValue

public void setValue(int value)
Sets the value of the mutable integer to the value given.

Parameters:
value - the value to set the internally stored mutable integer state to

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.