Package com.yahoo.lang
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
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 valueString
toString()
-
-
-
Method Detail
-
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
-
-