diff options
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo/lang/MutableInteger.java')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/lang/MutableInteger.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/lang/MutableInteger.java b/vespajlib/src/main/java/com/yahoo/lang/MutableInteger.java index a988a3f6fa2..e2da62b6098 100644 --- a/vespajlib/src/main/java/com/yahoo/lang/MutableInteger.java +++ b/vespajlib/src/main/java/com/yahoo/lang/MutableInteger.java @@ -24,6 +24,12 @@ public class MutableInteger { return value; } + /** Increments the value by 1 and returns the value of this *before* incrementing */ + public int next() { + value++; + return value - 1; + } + /** Adds the increment to the current value and returns the resulting value */ public int subtract(int increment) { value -= increment; |