edu.northwestern.at.utils

## Class MutableInteger

- java.lang.Object
- - java.lang.Number
  - - edu.northwestern.at.utils.MutableInteger

- All Implemented Interfaces:
    java.io.Serializable

      public class MutableInteger
      extends java.lang.Number
      implements java.io.Serializable

  Implements an integer object wrapper which allows changing the integer value.

  The built-in Java Integer class does not allow changing the value of the wrapped integer value once the Integer object is created. MutableInteger provides most of the same methods as Integer but adds extra methods to allow changing the value of the stored integer. This is useful when wrapping integers for storage in collection types since it is much more efficient to update the value of an existing MutableInteger than to create a new Integer every time the value changes.

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `mutableInteger` The integer wrapped here.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MutableInteger(int i)` Create MutableInteger object from an int value.
    `MutableInteger(java.lang.String s)` Create MutableInteger object from a string.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte` | `byteValue()`
    `int` | `compareTo(java.lang.Number number)` Compares this number to another number.
    `int` | `compareTo(java.lang.Object obj)` Compares this object to another object.
    `protected int` | `doCompare(int i, int j)`
    `double` | `doubleValue()`
    `boolean` | `equals(java.lang.Object obj)`
    `float` | `floatValue()`
    `int` | `hashCode()`
    `int` | `intValue()`
    `long` | `longValue()`
    `void` | `setValue(byte aByte)`
    `void` | `setValue(double d)`
    `void` | `setValue(float f)`
    `void` | `setValue(int i)`
    `void` | `setValue(long l)`
    `void` | `setValue(short aWord)`
    `short` | `shortValue()`
    `java.lang.Integer` | `toInteger()`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### mutableInteger

          protected int mutableInteger

      The integer wrapped here.

  - ### Constructor Detail

    - #### MutableInteger

          public MutableInteger(int i)

      Create MutableInteger object from an int value.
      Parameters:
        `i` - The integer being wrapped.

    - #### MutableInteger

          public MutableInteger(java.lang.String s)
                         throws java.lang.NumberFormatException

      Create MutableInteger object from a string.
      Parameters:
        `s` - String containing an integer value.
      Throws:
        `java.lang.NumberFormatException`

  - ### Method Detail

    - #### compareTo

          public int compareTo(java.lang.Object obj)

      Compares this object to another object.
      Parameters:
        `obj` - The other object.

    - #### compareTo

          public int compareTo(java.lang.Number number)

      Compares this number to another number.
      Parameters:
        `number` - The other number.

    - #### doCompare

          protected int doCompare(int i,
                      int j)

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### byteValue

          public byte byteValue()

      Overrides:
        `byteValue` in class `java.lang.Number`

    - #### shortValue

          public short shortValue()

      Overrides:
        `shortValue` in class `java.lang.Number`

    - #### intValue

          public int intValue()

      Specified by:
        `intValue` in class `java.lang.Number`

    - #### longValue

          public long longValue()

      Specified by:
        `longValue` in class `java.lang.Number`

    - #### floatValue

          public float floatValue()

      Specified by:
        `floatValue` in class `java.lang.Number`

    - #### doubleValue

          public double doubleValue()

      Specified by:
        `doubleValue` in class `java.lang.Number`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### setValue

          public void setValue(byte aByte)

    - #### setValue

          public void setValue(short aWord)

    - #### setValue

          public void setValue(int i)

    - #### setValue

          public void setValue(long l)

    - #### setValue

          public void setValue(float f)

    - #### setValue

          public void setValue(double d)

    - #### toInteger

          public java.lang.Integer toInteger()