java.util
Class Random

java.lang.Object
  |
  +--java.util.Random

public class Random
extends Object

난수 발생을 위한 클래스.


Constructor Summary
Random()
          현재 시각을 seed로하는 객체를 생성한다.
Random(long seed)
          특정 seed값을 초기값으로 가지는 객체를 생성한다.
 
Method Summary
protected  int next(int bits)
           
 int nextInt()
          정수형의 다음 난수를 구한다.
 long nextLong()
          Long형의 다음 난수를 구한다.
 void setSeed(long seed)
          객체의 seed를 변경한다.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Random

public Random()
현재 시각을 seed로하는 객체를 생성한다.

Random

public Random(long seed)
특정 seed값을 초기값으로 가지는 객체를 생성한다.
Parameters:
seed - 사용하고자 하는 seed값.
Method Detail

setSeed

public void setSeed(long seed)
객체의 seed를 변경한다.
Parameters:
seed - 새로운 seed값.

next

protected int next(int bits)

nextInt

public int nextInt()
정수형의 다음 난수를 구한다.
Returns:
정수형의 새로운 난수.

nextLong

public long nextLong()
Long형의 다음 난수를 구한다.
Returns:
Long형의 새로운 난수.


AromaSoft Corp. Proprietary and Confidential

(C)opyright 2003 AromaSoft Corp. All right reserved.
Contact : contact@aromasoft.com