Class MutableInt


  • public final class MutableInt
    extends Object
    Mutable integer class suitable for use with collection classes that take a type parameter.
    • Field Detail

      • value

        public int value
    • Constructor Detail

      • MutableInt

        public MutableInt()
        Create a mutable integer with initial value 0.
      • MutableInt

        public MutableInt​(int initialValue)
        Create a mutable integer with initial value initialValue.
        Parameters:
        initialValue -
    • Method Detail

      • incrementValue

        public MutableInt incrementValue​(int increment)
        Increment the current value by initialValue.
        Parameters:
        increment -
        Returns:
        The updated object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object