|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object powerball.Entry
public class Entry
Field Summary | |
---|---|
static int |
BALLS
|
static int |
INVALIDTEST
|
Constructor Summary | |
---|---|
Entry()
Creates a new instance of Entry - random |
|
Entry(java.lang.String nam)
Creates a new instance of Entry, random numbers - given location name |
|
Entry(java.lang.String nam,
int mon,
int[] nums,
int pb)
Creates a new instance of Entry, passed numbers - given location name - assume todays date |
|
Entry(java.lang.String nam,
int mon,
int day,
int yr)
Creates a new instance of Entry, random numbers - given location name and drawing date |
|
Entry(java.lang.String nam,
int mon,
int day,
int yr,
int[] nums,
int pb)
Creates a new instance of Entry, passed numbers - given location name and drawing date |
Method Summary | |
---|---|
boolean |
checkEntry(int[] winning,
int pb)
check entry against actual balls - return whether winner |
boolean |
equals(java.lang.Object obj)
check if two Entries have same contents - need policy decision - migth want to check to see if all of the numbers are the same - in which could use it to check if a winner. |
void |
genRandEntry()
Service method for generating a power ball entry. |
java.util.GregorianCalendar |
getDrawingDate()
report drawing date - as GregorianCalendar |
java.lang.String |
getDrawingDateAsString()
report drawing date as String |
boolean |
getHasBeenChecked()
report whether the entry has been checked against winning numbers |
int |
getNumBallsMatch()
report how many balls match - if hasn't been checked - return invalid indicator |
int[] |
getNumbers()
report regular numbers - question whether this should be public |
int |
getPowerball()
report powerball - - question whether this should be public |
boolean |
getPowerballMatches()
report whether entry powerball matches - if hasn't been checked can't be a winner |
java.lang.String |
getSoldLocation()
report sold location |
boolean |
getWinner()
report whether entry is a winner - if hasn't been checked can't be a winner |
boolean |
setDrawingDate(int mon,
int day,
int yr)
change drawing date - validation needs more work |
boolean |
setHasBeenChecked(boolean check)
change whether the entry has been checked |
boolean |
setHasBeenChecked(boolean check,
boolean win)
change whether the entry has been checked - and whether the entry is a winner |
boolean |
setNumbers(int[] nums)
change numbers - question whether this should be public. |
boolean |
setPowerball(int pb)
change powerball - question whether this should be public |
boolean |
setSoldLocation(java.lang.String loc)
change sold location |
boolean |
setWinner(boolean win)
change winner - question - should this mean that the entry has been checked? |
java.lang.String |
toString()
return a string representation for the Entry |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int BALLS
public static final int INVALIDTEST
Constructor Detail |
---|
public Entry()
public Entry(java.lang.String nam)
public Entry(java.lang.String nam, int mon, int day, int yr)
public Entry(java.lang.String nam, int mon, int day, int yr, int[] nums, int pb)
public Entry(java.lang.String nam, int mon, int[] nums, int pb)
Method Detail |
---|
public void genRandEntry()
public java.lang.String getSoldLocation()
public java.util.GregorianCalendar getDrawingDate()
public java.lang.String getDrawingDateAsString()
public int[] getNumbers()
public int getPowerball()
public boolean getHasBeenChecked()
public boolean getWinner()
public int getNumBallsMatch()
public boolean getPowerballMatches()
public boolean setSoldLocation(java.lang.String loc)
public boolean setDrawingDate(int mon, int day, int yr)
public boolean setNumbers(int[] nums)
public boolean setPowerball(int pb)
public boolean setWinner(boolean win)
public boolean setHasBeenChecked(boolean check)
public boolean setHasBeenChecked(boolean check, boolean win)
public boolean checkEntry(int[] winning, int pb)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |