org.apache.commons.lang.math
クラス JVMRandom

java.lang.Object
  拡張java.util.Random
      拡張org.apache.commons.lang.math.JVMRandom
すべての実装インタフェース:
Serializable

public final class JVMRandom
extends Random

JVMRandom is a wrapper that supports all possible Random methods via the Math.random() method and its system-wide Random object.

導入されたバージョン:
2.0
バージョン:
$Id: JVMRandom.java,v 1.1.1.1 2004/02/13 10:02:05 hioki Exp $
作成者:
Henri Yandell
関連項目:
直列化された形式

コンストラクタの概要
JVMRandom()
           
 
メソッドの概要
 boolean nextBoolean()
          Returns the next pseudorandom, uniformly distributed boolean value from the Math.random() sequence.
 void nextBytes(byte[] byteArray)
          Unsupported in 2.0.
 double nextDouble()
          Synonymous to the Math.random() call.
 float nextFloat()
          Returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from the Math.random() sequence.
 double nextGaussian()
          Unsupported in 2.0.
 int nextInt()
          Returns the next pseudorandom, uniformly distributed int value from the Math.random() sequence.
 int nextInt(int n)
          Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), from the Math.random() sequence.
 long nextLong()
          Returns the next pseudorandom, uniformly distributed long value from the Math.random() sequence.
static long nextLong(long n)
          Returns a pseudorandom, uniformly distributed long value between 0 (inclusive) and the specified value (exclusive), from the Math.random() sequence.
 void setSeed(long seed)
          Unsupported in 2.0.
 
クラス java.util.Random から継承したメソッド
next
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

JVMRandom

public JVMRandom()
メソッドの詳細

setSeed

public void setSeed(long seed)
Unsupported in 2.0.


nextGaussian

public double nextGaussian()
Unsupported in 2.0.


nextBytes

public void nextBytes(byte[] byteArray)
Unsupported in 2.0.


nextInt

public int nextInt()

Returns the next pseudorandom, uniformly distributed int value from the Math.random() sequence.

戻り値:
the random int

nextInt

public int nextInt(int n)

Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), from the Math.random() sequence.

パラメータ:
n - the specified exclusive max-value
戻り値:
the random int
例外:
IllegalArgumentException - when n <= 0

nextLong

public long nextLong()

Returns the next pseudorandom, uniformly distributed long value from the Math.random() sequence.

戻り値:
the random long

nextLong

public static long nextLong(long n)

Returns a pseudorandom, uniformly distributed long value between 0 (inclusive) and the specified value (exclusive), from the Math.random() sequence.

パラメータ:
n - the specified exclusive max-value
戻り値:
the random long
例外:
IllegalArgumentException - when n <= 0

nextBoolean

public boolean nextBoolean()

Returns the next pseudorandom, uniformly distributed boolean value from the Math.random() sequence.

戻り値:
the random boolean

nextFloat

public float nextFloat()

Returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from the Math.random() sequence.

戻り値:
the random float

nextDouble

public double nextDouble()

Synonymous to the Math.random() call.

戻り値:
the random double


このドキュメントは、Ja-Jakartaにより訳されました。 コメントがある場合は report@jajakarta.orgまでお願いします。
Translated into Japanese by jajakarta.org. The original page is here.
Copyright (c) 2002-2003 - Apache Software Foundation