Package com.yahoo.lang
Class MutableInteger
java.lang.Object
com.yahoo.lang.MutableInteger
A mutable integer
- Author:
- bratseth
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
add
(int increment) Adds the increment to the current value and returns the resulting valueint
get()
int
next()
Increments the value by 1 and returns the value of this *before* incrementingvoid
set
(int value) int
subtract
(int increment) Adds the increment to the current value and returns the resulting valuetoString()
-
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
-