NavalBattle
Class MyRandom

java.lang.Object
  |
  +--NavalBattle.MyRandom
All Implemented Interfaces:
java.io.Serializable

public class MyRandom
extends java.lang.Object
implements java.io.Serializable

MyRandom

See Also:
Serialized Form

Constructor Summary
MyRandom()
          Inizializza la classe utilizzando il Timer del sistema.
MyRandom(long Seed)
          Inizializza la classe utilizzando Seed.
 
Method Summary
 boolean nextBoolean()
          Restituisce un valore di tipo boolean.
 void nextBytes(byte[] abyte0)
          Restituisce un valore di tipo byte.
 double nextDouble()
          Restituisce un double.
 float nextFloat()
          Restituisce un float.
 double nextGaussian()
           
 int nextInt()
          Restituisce un Intero (a 32 bit) positivo o negativo.
 int nextInt(int max)
          Restituisce un numero intero positivo nel seguente intervallo:
0 <= x < max
Notare che il valore è sempre minore di max!
 long nextLong()
          Restituisce un long.
 void setSeed(long Seed)
          Cambia l'inizializzatore dell'istanza.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyRandom

public MyRandom()
Inizializza la classe utilizzando il Timer del sistema.


MyRandom

public MyRandom(long Seed)
Inizializza la classe utilizzando Seed.

Method Detail

setSeed

public void setSeed(long Seed)
Cambia l'inizializzatore dell'istanza.


nextInt

public int nextInt()
Restituisce un Intero (a 32 bit) positivo o negativo.


nextInt

public int nextInt(int max)
Restituisce un numero intero positivo nel seguente intervallo:
0 <= x < max

Notare che il valore è sempre minore di max!


nextFloat

public float nextFloat()
Restituisce un float.


nextLong

public long nextLong()
Restituisce un long.


nextBytes

public void nextBytes(byte[] abyte0)
Restituisce un valore di tipo byte.


nextGaussian

public double nextGaussian()

nextDouble

public double nextDouble()
Restituisce un double.


nextBoolean

public boolean nextBoolean()
Restituisce un valore di tipo boolean.



Copyright © 2004 Giorgio Bernardi. All Rights Reserved.