Created
November 23, 2015 06:57
-
-
Save tycoi2005/0eed8a7b0f0124d79c83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Random; | |
public class RandomLong { | |
private static Random r = new Random(); | |
private long randomSeed; | |
private long otherValue; | |
public RandomLong(long value) { | |
randomSeed = r.nextLong(); | |
otherValue = value + randomSeed; | |
} | |
public long getValue() { | |
return otherValue - randomSeed; | |
} | |
public void incr(long value) { | |
otherValue += value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment