org.apache.myfaces.util
Class ThreadsafeXorShiftRandom
java.lang.Object
org.apache.myfaces.util.XorShiftRandom
org.apache.myfaces.util.ThreadsafeXorShiftRandom
public class ThreadsafeXorShiftRandom
- extends XorShiftRandom
A threadsafe implementation of XorShiftRandom
.
We use a ThreadLocal to give each thread it's own implementation.
Method Summary |
long |
random()
We use the random generator for this very thread. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThreadsafeXorShiftRandom
public ThreadsafeXorShiftRandom()
random
public long random()
- We use the random generator for this very thread.
This method is perfectly threadsafe. It is also guaranteed
that each thread will get own values.
- Overrides:
random
in class XorShiftRandom
- Returns:
Copyright © 2014 The Apache Software Foundation. All rights reserved.