Skip to content

Instantly share code, notes, and snippets.

@tycoi2005
Created November 23, 2015 06:57
Show Gist options
  • Save tycoi2005/0eed8a7b0f0124d79c83 to your computer and use it in GitHub Desktop.
Save tycoi2005/0eed8a7b0f0124d79c83 to your computer and use it in GitHub Desktop.
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