Class MutableInteger

java.lang.Object
com.yahoo.lang.MutableInteger

public class MutableInteger extends Object
A mutable integer
Author:
bratseth
  • Constructor Summary

    Constructors
    Constructor
    Description
    MutableInteger(int value)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    add(int increment)
    Adds the increment to the current value and returns the resulting value
    int
    get()
     
    int
    Increments the value by 1 and returns the value of this *before* incrementing
    void
    set(int value)
     
    int
    subtract(int increment)
    Adds the increment to the current value and returns the resulting value
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MutableInteger

      public MutableInteger(int value)
  • Method Details

    • get

      public int get()
    • set

      public void set(int value)
    • add

      public int add(int increment)
      Adds the increment to the current value and returns the resulting value
    • next

      public int next()
      Increments the value by 1 and returns the value of this *before* incrementing
    • subtract

      public int subtract(int increment)
      Adds the increment to the current value and returns the resulting value
    • toString

      public String toString()
      Overrides:
      toString in class Object