From c078f34cefb845829b6fa04903964db7d55431cf Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Mon, 15 Apr 2002 17:13:38 +0000 Subject: [PATCH] Code and documentation reparations, per Mr. Greenwell. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1242 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/util/RandomUtil.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/java/com/threerings/util/RandomUtil.java b/src/java/com/threerings/util/RandomUtil.java index f2cd322a4..f6ee313c8 100644 --- a/src/java/com/threerings/util/RandomUtil.java +++ b/src/java/com/threerings/util/RandomUtil.java @@ -1,5 +1,5 @@ // -// $Id: RandomUtil.java,v 1.3 2002/01/15 18:05:01 shaper Exp $ +// $Id: RandomUtil.java,v 1.4 2002/04/15 17:13:38 mdb Exp $ package com.threerings.media.util; @@ -12,27 +12,28 @@ import java.util.Random; */ public class RandomUtil { + /** The random number generator used by the methods in this class. */ + public static final Random rand = new Random(); + /** * Returns a pseudorandom, uniformly distributed int - * value between 0 (inclusive) and the specified value - * (exclusive). + * value between 0 (inclusive) and the specified value (exclusive). * * @param high the high value limiting the random number sought. */ public static int getInt (int high) { - return _rnd.nextInt(high); + return rand.nextInt(high); } /** * Returns a pseudorandom, uniformly distributed float value between - * 0.0 (inclusive) and the specified value (inclusive). + * 0.0 (inclusive) and the specified value (exclusive). + * + * @param high the high value limiting the random number sought. */ public static float getFloat (float high) { - return _rnd.nextFloat() * high; + return rand.nextFloat() * high; } - - /** The random object from which we choose random numbers. */ - protected static Random _rnd = new Random(); }