예제 #1
0
 internal RandomLongsSpliterator(SplittableRandom rng, long index, long fence, long origin, long bound)
 {
     this.Rng    = rng;
     this.Index  = index;
     this.Fence  = fence;
     this.Origin = origin;
     this.Bound  = bound;
 }
예제 #2
0
            public void ForEachRemaining(LongConsumer consumer)
            {
                if (consumer == null)
                {
                    throw new NullPointerException();
                }
                long i = Index, f = Fence;

                if (i < f)
                {
                    Index = f;
                    SplittableRandom r = Rng;
                    long             o = Origin, b = Bound;
                    do
                    {
                        consumer.Accept(r.InternalNextLong(o, b));
                    } while (++i < f);
                }
            }
예제 #3
0
 internal SplittableRandomGenerator(SplittableRandom random)
 {
     this._random = random;
 }