public class RefreshTask
extends java.util.TimerTask
Constructor and Description |
---|
RefreshTask(ComanalyzerPlugin plugin,
long period)
Create a new RefreshTask.
|
RefreshTask(ComanalyzerPlugin plugin,
long period,
java.util.List durations)
Since TimerTasks cant be rescheduled, this constructor provides the
possibility to pass the durationlist from an other task to this one.
|
Modifier and Type | Method and Description |
---|---|
boolean |
cancel()
Cancel the task.
|
void |
fireMessagesAdded(Message[] messages)
This method is call by the plugin to pass the messages to be added.
|
long |
getAverageExecutionDuration(int number) |
protected java.util.List |
getDurations() |
long |
getLastExecutionDuration() |
int |
getMessageSize() |
protected long |
getPeriod() |
boolean |
isCanceld() |
boolean |
isDone() |
void |
run()
Invokes the messagesAdded notification on the awt thread and meseasures
the duration.
|
public RefreshTask(ComanalyzerPlugin plugin, long period)
period
- The period this task is scheduled in the timer.plugin
- The ComanalyzerPlugin.public RefreshTask(ComanalyzerPlugin plugin, long period, java.util.List durations)
plugin
- The ComanalyzerPlugin.period
- The period this task is scheduled in the timer.durations
- The passed durationlist.public void fireMessagesAdded(Message[] messages)
messages
- The messages to be added.public int getMessageSize()
public boolean cancel()
cancel
in class java.util.TimerTask
public void run()
run
in interface java.lang.Runnable
run
in class java.util.TimerTask
public boolean isDone()
true
if the task is done.public boolean isCanceld()
true
if the task is cancelledpublic long getAverageExecutionDuration(int number)
number
- The count of the last durations the average is calculated
from.number
executions.public long getLastExecutionDuration()
protected long getPeriod()
protected java.util.List getDurations()