Class MutableInteger


  • public class MutableInteger
    extends Object
    Like an Integer, but mutable :) Sometimes it is just really convenient to be able to pass a MutableInteger as a parameter to a function, or for synchronization purposes (so that you can guard access to an int value without creating a separate Object just to synchronize on). NOT thread-safe
    • Constructor Detail

      • MutableInteger

        public MutableInteger​(int i)
    • Method Detail

      • intValue

        public int intValue()
      • integerValue

        public Integer integerValue()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • setValue

        public void setValue​(int value)
      • increment

        public void increment()
      • add

        public void add​(int amount)
      • decrement

        public void decrement()
      • subtract

        public void subtract​(int amount)