|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.util.TimerTask
MyTimerTask
class MyTimerTask
MyTimerTask is a sub class of the TimerTask class. This class defines tasks that are performed when a Timer object starts operations according to a specified schedule.
| Field Summary | |
|---|---|
private PlusNumber |
owner
PlusNumber object that creates and has this TimerTask object. |
private java.lang.String |
sessionState
String representing the current session state. |
| Fields inherited from interface Constants |
|---|
BIG_FONT, CREAM1, CREAM2, CYAN, IMG_FILE_NAMES_MAIN, IMG_FILE_NAMES_NUMBER, IMG_FILE_NAMES_SPLASH, INST_HEADINGS, INST_IMG_FILE_NAMES, MAX_TIME, MEDIUM_FONT, MENU_ITEM_NAMES, MENU_NAMES, NOT_SELECTED, ORANGE, PLAYED, RED, SELECTED, SMALL_FONT, SMALLER_FONT, SMALLEST_FONT, SOUND_FILE_NAMES, YELLOW |
| Constructor Summary | |
|---|---|
MyTimerTask()
Default constructor that initialise attributes by caling a non-default constructor. |
|
MyTimerTask(PlusNumber owner)
Constructor initialising all attributes with receiving one argument. |
|
MyTimerTask(PlusNumber owner,
java.lang.String sessionState)
Constructor initialising all attributes with receiving two arguments. |
|
| Method Summary | |
|---|---|
private void |
processCorrectAfterOneSecond()
This method is called by a GamePanelActionLister object when a game panel is clicked and the total sum becomes equals to a question number. |
private void |
processExceedAfterOneSecond()
This method is called by a GamePanelActionLister object when a game panel is clicked and the total sum exceeds a question number. |
private void |
processTimer()
This method defines tasks of the countdown timer on the main game window. |
void |
run()
This method will be automatically called when the "scheduleAtFixedRate" or "schedule" method of the Timer class is called. |
| Methods inherited from class java.util.TimerTask |
|---|
cancel, scheduledExecutionTime |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private PlusNumber owner
private java.lang.String sessionState
| Constructor Detail |
|---|
public MyTimerTask(PlusNumber owner,
java.lang.String sessionState)
owner - a parent PlusNumber object.sessionState - string representing a state of
a game session (either "correct" or "exceed")public MyTimerTask(PlusNumber owner)
owner - a parent PlusNumber object.public MyTimerTask()
| Method Detail |
|---|
public void run()
run in interface java.lang.Runnablerun in class java.util.TimerTaskprivate void processCorrectAfterOneSecond()
private void processExceedAfterOneSecond()
private void processTimer()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||