public class DefaultProgressListener extends NullProgressListener implements ProgressListener
ProgressListener
that does retain exceptions.
We do not put particular attention on the management of canceled, started, completed, this is a default implementation.
Modifier and Type | Class and Description |
---|---|
static class |
DefaultProgressListener.Warning
Collector class for warnings.
|
Constructor and Description |
---|
DefaultProgressListener() |
Modifier and Type | Method and Description |
---|---|
void |
complete()
Notifies this listener that the operation has finished.
|
void |
dispose()
Releases any resources used by this listener.
|
void |
exceptionOccurred(Throwable exception)
Reports an exception.
|
Queue<Throwable> |
getExceptions()
Return a copy of the
Queue of exceptions that had happened. |
float |
getProgress()
Returns the current progress as a percent completed.
|
InternationalString |
getTask()
Returns the description of the current task being performed, or
null if none. |
Queue<DefaultProgressListener.Warning> |
getWarnings()
Retrieves a copy of the warnings occurred.
|
boolean |
hasExceptions()
It tells us if we have exceptions or not.
|
boolean |
isCompleted()
Is the task we are listening is completed.
|
boolean |
isStarted()
Is the task we are listening for started.
|
void |
progress(float percent)
Notifies this listener of progress in the lengthly operation.
|
void |
setTask(InternationalString task)
Sets the description of the current task being performed.
|
void |
started()
Notifies this listener that the operation begins.
|
String |
toString() |
void |
warningOccurred(String source,
String margin,
String warning)
Reports a warning.
|
getDescription, isCanceled, setCanceled, setDescription
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isCanceled, setCanceled
public void complete()
ProgressListener
complete
in interface ProgressListener
complete
in class NullProgressListener
public void dispose()
ProgressListener
dispose
in interface ProgressListener
dispose
in class NullProgressListener
public void exceptionOccurred(Throwable exception)
ProgressListener
exceptionOccurred
in interface ProgressListener
exceptionOccurred
in class NullProgressListener
exception
- The exception to report.public void progress(float percent)
ProgressListener
progress
in interface ProgressListener
progress
in class NullProgressListener
percent
- The progress as a value between 0 and 100 inclusive.public void started()
ProgressListener
started
in interface ProgressListener
started
in class NullProgressListener
public void warningOccurred(String source, String margin, String warning)
ProgressListener
warningOccurred
in interface ProgressListener
warningOccurred
in class NullProgressListener
source
- Name of the warning source, or null
if none. This is typically the
filename in process of being parsed or the URL of the data being processedmargin
- Text to write on the left side of the warning message, or null
if
none. This is typically the line number where the error occured in the source
file or the feature ID of the feature that produced the messagewarning
- The warning message.public float getProgress()
ProgressListener
getProgress
in interface ProgressListener
getProgress
in class NullProgressListener
public InternationalString getTask()
ProgressListener
null
if none. It is
assumed that if the task is null
applications may simply report that the process is
"in progress" or "working" as represented in the current locale.getTask
in interface ProgressListener
getTask
in class NullProgressListener
null
if none.public void setTask(InternationalString task)
ProgressListener
setTask
in interface ProgressListener
setTask
in class NullProgressListener
task
- Description of the task being performed, or null
if none.public boolean isCompleted()
true
if the task is completed, false
if it is not.public Queue<Throwable> getExceptions()
Queue
of exceptions that had happened.Queue
of exceptions that had happened.public boolean hasExceptions()
true
if there are exceptions, false
otherwise.public boolean isStarted()
true
if the task is started, false
if it is not.public Queue<DefaultProgressListener.Warning> getWarnings()
Copyright © 1996–2023 Geotools. All rights reserved.