FileDocCategorySizeDatePackage
BingoBall.javaAPI DocExample1560Tue Dec 12 18:58:42 GMT 2000bingo.shared

BingoBall

public class BingoBall extends Object implements Serializable

Fields Summary
public int
number
private char
letter
public static final int
FREE_SPACE
public static final int
GAME_OVER
public static final int
MIN
public static final int
MAX
public static final int
RANGE
public static final int
MAX_B
public static final int
MAX_I
public static final int
MAX_N
public static final int
MAX_G
public static final int
MAX_O
Constructors Summary
public BingoBall(byte[] b)


       
	this(b[0]);
    
public BingoBall(int n)

	if (n >= MIN && n <= MAX) {
	    number = n;
	    if (n <= MAX_B) letter = 'B";
	    else if (n <= MAX_I) letter = 'I";
	    else if (n <= MAX_N) letter = 'N";
	    else if (n <= MAX_G) letter = 'G";
	    else if (n <= MAX_O) letter = 'O";
	} else if (n == GAME_OVER) {
	    number = GAME_OVER;
	    letter = ' ";
	} else {
	    number = FREE_SPACE;
	    letter = ' ";
	}
    
Methods Summary
public booleanequals(java.lang.Object obj)

	if (!(obj instanceof BingoBall))
	    return false;
	return ((BingoBall)obj).number == number;
    
public byte[]getBytes()

	byte[] answer = { (byte)number };
	return answer;
    
public chargetLetter()

	return letter;
    
public intgetNumber()

	return number;
    
public inthashCode()

	return number;
    
public java.lang.StringtoString()

	return new StringBuffer().append(letter).append(number).toString();