|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.dolben.MarkN.Numbah
public class Numbah
This is an N Digit Number. Note that it is called "Numbah" (the New England pronunciation) to disambiguate it from java.lang.Number without having to use the whole name.
| Constructor Summary | |
|---|---|
Numbah()
constructs a number |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
makes a new copy of this number |
void |
copy(Numbah n)
copies a given number into this one |
int |
getDigit(int place)
gets the digit in a given place |
static Numbah |
random()
makes a pseudorandom number |
Score |
score(Numbah guess)
scores a guess with this number as the target |
void |
setDigit(int digit,
int place)
sets a digit of this number |
java.lang.String |
toString()
makes a string of the digits in this number |
boolean |
valid()
tests the validity of this number (no two digits the same) |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Numbah()
| Method Detail |
|---|
public java.lang.Object clone()
clone in class java.lang.Objectpublic void copy(Numbah n)
n - the number to be copied
public void setDigit(int digit,
int place)
digit - the new digitplace - the place to setpublic boolean valid()
public int getDigit(int place)
place - which digit to get
public static Numbah random()
public java.lang.String toString()
toString in class java.lang.Objectpublic Score score(Numbah guess)
guess - the guess to score
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||