diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-02-21 18:47:20 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2018-02-21 18:47:20 +0100 |
commit | acfdb9e6c61b9f8d065645a657c130bd2cb49c87 (patch) | |
tree | f98e707acaa41496d4d1277dd3535569f623f5a6 /vespajlib/src/main/java/com/yahoo/lang/MutableLong.java | |
parent | 31805b7b9640302067713ce05573d9d1e5c92f39 (diff) |
Deduce correct concat type
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo/lang/MutableLong.java')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/lang/MutableLong.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/lang/MutableLong.java b/vespajlib/src/main/java/com/yahoo/lang/MutableLong.java new file mode 100644 index 00000000000..e0e4a0828a9 --- /dev/null +++ b/vespajlib/src/main/java/com/yahoo/lang/MutableLong.java @@ -0,0 +1,33 @@ +// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.lang; + +/** + * A mutable long + * + * @author bratseth + */ +public class MutableLong { + + private long value; + + public MutableLong(long value) { + this.value = value; + } + + public long get() { return value; } + + public void set(long value) { this.value = value; } + + /** Adds the increment to the current value and returns the resulting value */ + public long add(long increment) { + value += increment; + return value; + } + + /** Adds the increment to the current value and returns the resulting value */ + public long subtract(long increment) { + value -= increment; + return value; + } + +} |