FileDocCategorySizeDatePackage
Die.javaAPI DocExample580Mon Feb 13 12:32:02 GMT 2006None

Die

public class Die extends Object implements Serializable

Fields Summary
private int
face
Random
shooter
Constructors Summary
public Die(int face)


     
    if (face < 1 || face > 6) throw new IllegalArgumentException();
    this.face = face;
  
Methods Summary
public final intgetFace()

    return this.face;
  
public introll()

    this.face = (Math.abs(shooter.nextInt()) % 6) + 1;
    return this.face;
  
public voidsetFace(int face)

    if (face < 1 || face > 6) throw new IllegalArgumentException();
    this.face = face;