|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgui.run.RunJob
public abstract class RunJob
| Field Summary | |
|---|---|
static int |
MAX_PRIORITY
The maximum priority that a RunJob can have. |
static int |
MIN_PRIORITY
The minimum priority that a RunJob can have. |
static int |
NORM_PRIORITY
The default priority that is assigned to a RunJob. |
| Constructor Summary | |
|---|---|
RunJob(double seconds)
Runs the run() method every seconds. |
|
RunJob(double seconds,
boolean wait)
Run the RunJob every seconds If wait is
true then do not start the RunJob until the start
method is invoked. |
|
RunJob(double seconds,
boolean wait,
int maximumNumberOfTimesRun)
Run the RunJob every so many seconds If wait is
true then do not start the RunJob until the start
method is invoked. |
|
RunJob(double seconds,
boolean wait,
int maximumNumberOfTimesToRun,
boolean isDaemon)
Run the RunJob every seconds If wait is
true then do not start the RunJob until the start
method is invoked. |
|
RunJob(double seconds,
boolean wait,
int maximumNumberOfTimesRun,
boolean isDaemon,
int priority)
Run the RunJob every seconds If wait is
true then do not start the RunJob until the start
method is invoked. |
|
| Method Summary | |
|---|---|
long |
getCurrent()
How many ms you have left. |
long |
getLengthOfTask()
|
java.lang.String |
getMessage()
|
java.lang.String |
getName()
Gets the name of this RunJob (and the thread upon which the RunJob is based First the checkAccess method of this thread is called
with no arguments. |
int |
getNumberOfTimesRun()
|
int |
getPriority()
Returns this RunJob's priority. |
boolean |
isAlive()
Tests if this RunJob is alive. |
boolean |
isDaemon()
Tests if the RunJob is a daemon RunJob. |
boolean |
isDone()
|
static void |
main(java.lang.String[] args)
|
void |
restart()
|
void |
setName(java.lang.String name)
Changes the name of this RunJob (and thread upon which the RunJob is based, to be equal to the argument name. |
void |
setPriority(int priority)
Changes the priority of this RunJob. |
void |
start()
Start will restart a RunJob that was stopped. |
void |
stop()
Stops the RunJob by causing a thread death. |
java.lang.String |
toString()
Returns a string representation of this RunJob, including the RunJob's name, priority, and thread group to which the RunJob's thread belongs. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.lang.Runnable |
|---|
run |
| Field Detail |
|---|
public static final int MIN_PRIORITY
public static final int NORM_PRIORITY
public static final int MAX_PRIORITY
| Constructor Detail |
|---|
public RunJob(double seconds)
run() method every seconds.
The job starts right away.
seconds - shows how many seconds between jobs
public RunJob(double seconds,
boolean wait)
seconds If wait is
true then do not start the RunJob until the start
method is invoked. Otherwise, start right away.
seconds - shows how many seconds between jobswait - if true, will wait before start
public RunJob(double seconds,
boolean wait,
int maximumNumberOfTimesRun)
seconds If wait is
true then do not start the RunJob until the start
method is invoked. Otherwise, start right away. If the
maximumNumberOfTimesRun is present, then the job only executes
maximumNumberOfTimesRun times.
- Parameters:
seconds - shows how many seconds between jobswait - if true, will wait before startmaximumNumberOfTimesRun - Integer.MINVALUE is infinite
public RunJob(double seconds,
boolean wait,
int maximumNumberOfTimesToRun,
boolean isDaemon)
seconds If wait is
true then do not start the RunJob until the start
method is invoked. Otherwise, start right away. If the
count is present, then the job only executes
count. isDaemon Marks this RunJob as
either a daemon RunJob or a user RunJob. The Java Virtual Machine
exits when the only RunJobs running are all daemon RunJobs and all
Threads are daemon threads. The default value for
isDaemon is false.
- Parameters:
seconds - seconds of wait between jobswait - true if you want to delay startmaximumNumberOfTimesToRun - number of times to execute. Integer.MINVALUE is
infiniteisDaemon - true if you want to exit on main exit
public RunJob(double seconds,
boolean wait,
int maximumNumberOfTimesRun,
boolean isDaemon,
int priority)
seconds If wait is
true then do not start the RunJob until the start
method is invoked. Otherwise, start right away. If the
maximumNumberOfTimesRun is present, then the job only executes
maximumNumberOfTimesRun. isDaemon Marks this RunJob as
either a daemon RunJob or a user RunJob. The Java Virtual Machine
exits when the only RunJobs running are all daemon RunJobs and all
Threads are daemon threads. The default value for
isDaemon is false.
- Parameters:
seconds - seconds of wait between jobswait - true if you want to delay startmaximumNumberOfTimesRun - number of times to execute. Integer.MINVALUE is
infiniteisDaemon - true if you want to exit on main exitpriority - the internal threads priority.
| Method Detail |
|---|
public int getNumberOfTimesRun()
public void setPriority(int priority)
SecurityException.
Otherwise, the priority of this RunJob is set to the smaller of the
specified newPriority and the maximum permitted
priority of the RunJobs's thread group. If the priority is smaller
than MIN_PRIORITY then it will be set to
MIN_PRIORITY. If the priority is greater than
MAX_PRIORITY then it will be set to
MAX_PRIORITY. This avoids illegal arguments.
priority - priority to set this RunJob to
java.lang.SecurityException - if the current RunJob cannot modify its
thread.getPriority(),
MAX_PRIORITY,
MIN_PRIORITYpublic final int getPriority()
setPriority(int),
Thread.setPriority(int)public long getLengthOfTask()
getLengthOfTask in interface RunProgressInterfacepublic void start()
start in interface RunProgressInterfacepublic boolean isDone()
isDone in interface RunProgressInterfacepublic void setName(java.lang.String name)
name.
First the checkAccess method of this thread is called
with no arguments. This may result in throwing a
SecurityException.
name - the new name for this thread.public java.lang.String getName()
checkAccess method of this thread is called
with no arguments. This may result in throwing a
SecurityException.
public void stop()
start()
invocation Will make a new thread and restart the RunJob.
stop in interface RunProgressInterfacepublic long getCurrent()
RunProgressInterface
getCurrent in interface RunProgressInterfacepublic java.lang.String getMessage()
getMessage in interface RunProgressInterfacepublic boolean isDaemon()
true if this RunJob is a daemon RunJob;
false otherwise.public boolean isAlive()
true if this RunJob is alive;
false otherwise.public java.lang.String toString()
toString in class java.lang.Objectpublic void restart()
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||