|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.das2.util.monitor.SubTaskMonitor
public class SubTaskMonitor
creates a ProgressMonitor that maps its progress to a parent's progress. For example, if a process takes a progress monitor, but is implemented in two steps that each take a progress monitor, then two subtask monitors can be created to monitor each step, and the client who passed in the monitor will see the whole deal as one process.
Field Summary |
---|
Fields inherited from interface org.das2.util.monitor.ProgressMonitor |
---|
NULL, SIZE_INDETERMINATE |
Method Summary | |
---|---|
void |
cancel()
Notifies the ProgressMonitor that the task
being monitored should be canceled. |
static SubTaskMonitor |
create(ProgressMonitor parent,
long min,
long max)
|
void |
finished()
Notifies the ProgressMonitor that the task
being monitored has finished. |
java.lang.String |
getLabel()
Return the label string displayed. |
long |
getTaskProgress()
Returns the current progress of the monitored task. |
long |
getTaskSize()
|
boolean |
isCancelled()
Returns true if the operation being tracked
should be cancelled. |
boolean |
isFinished()
true if the process has indicated that it is finished |
boolean |
isStarted()
true if the process has indicated that it has started. |
void |
setAdditionalInfo(java.lang.String s)
Deprecated. |
void |
setLabel(java.lang.String label)
Set a consise string that describes the task being performed. |
void |
setProgressMessage(java.lang.String message)
Provides additional feedback as to what's going on in the process. |
void |
setTaskProgress(long position)
Notifies the ProgressMonitor of a change in the progress of the task. |
void |
setTaskSize(long taskSize)
Sets the maximum value for the task progress of this ProgressMonitor . |
void |
started()
Notifies the ProgressMonitor that the task
being monitored has started. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static SubTaskMonitor create(ProgressMonitor parent, long min, long max)
public void cancel()
ProgressMonitor
ProgressMonitor
that the task
being monitored should be canceled. After this method is
called, implementations should return true
on
any subsequent calls to ProgressMonitor.isCancelled()
and should
throw an IllegalStateException on any subsequent calls to
ProgressMonitor.setTaskProgress(long)
.
cancel
in interface ProgressMonitor
public void finished()
ProgressMonitor
ProgressMonitor
that the task
being monitored has finished.
finished
in interface ProgressMonitor
public boolean isFinished()
ProgressMonitor
isFinished
in interface ProgressMonitor
public long getTaskProgress()
ProgressMonitor
getTaskProgress
in interface ProgressMonitor
public boolean isCancelled()
ProgressMonitor
true
if the operation being tracked
should be cancelled.
isCancelled
in interface ProgressMonitor
true
if the operation being tracked
should be cancelled.@Deprecated public void setAdditionalInfo(java.lang.String s)
ProgressMonitor
setAdditionalInfo
in interface ProgressMonitor
public void setTaskProgress(long position) throws java.lang.IllegalArgumentException
ProgressMonitor
setTaskProgress
in interface ProgressMonitor
position
- the current task position
java.lang.IllegalArgumentException
- if ProgressMonitor.isCancelled()
returns true or,
possibly if started() has not been called or
finished() has been called.public void setTaskSize(long taskSize)
ProgressMonitor
ProgressMonitor
.
setTaskSize
in interface ProgressMonitor
taskSize
- maximum value for the task progress. A taskSize of -1 indicates the taskSize is indeterminate.public long getTaskSize()
getTaskSize
in interface ProgressMonitor
public void started()
ProgressMonitor
ProgressMonitor
that the task
being monitored has started. If the ProgressMonitor
is in a cancelled state when this method is called, that
ProgressMonitor
should be 'uncancelled'.
started
in interface ProgressMonitor
public boolean isStarted()
ProgressMonitor
isStarted
in interface ProgressMonitor
public void setLabel(java.lang.String label)
ProgressMonitor
setLabel
in interface ProgressMonitor
public java.lang.String getLabel()
ProgressMonitor
getLabel
in interface ProgressMonitor
public java.lang.String toString()
toString
in class java.lang.Object
public void setProgressMessage(java.lang.String message)
ProgressMonitor
setProgressMessage
in interface ProgressMonitor
message
- the message describing the state of progress.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |