|
||||||||||
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 doCommand() every |
|
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 count)
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 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 count,
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 | |
---|---|
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. |
static void |
main(java.lang.String[] args)
|
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)
doCommand() every seconds.
The job starts right away.
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.
public RunJob(double seconds, boolean wait, int count)
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.
- Parameters:
count
- 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 count, 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
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 startcount
- 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_PRIORITY
public final int getPriority()
setPriority(int)
,
Thread.setPriority(int)
public void start()
public 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.
public 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.Object
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |