edu.northwestern.at.utils

## Class MutableLong

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

- All Implemented Interfaces:
    java.io.Serializable

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

  Implements a long object wrapper which allows changing the long value.

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

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected long` | `mutableLong` The long wrapped here.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MutableLong(long l)` Create MutableLong object from an int value.
    `MutableLong(java.lang.String s)` Create MutableLong 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(long i, long 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.Long` | `toLong()`
    `java.lang.String` | `toString()`

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

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

- - ### Field Detail

    - #### mutableLong

          protected long mutableLong

      The long wrapped here.

  - ### Constructor Detail

    - #### MutableLong

          public MutableLong(long l)

      Create MutableLong object from an int value.
      Parameters:
        `l` - The long being wrapped.

    - #### MutableLong

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

      Create MutableLong 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(long i,
                      long 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)

    - #### toLong

          public java.lang.Long toLong()