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, setDescriptionclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisCanceled, setCanceledpublic void complete()
ProgressListenercomplete in interface ProgressListenercomplete in class NullProgressListenerpublic void dispose()
ProgressListenerdispose in interface ProgressListenerdispose in class NullProgressListenerpublic void exceptionOccurred(Throwable exception)
ProgressListenerexceptionOccurred in interface ProgressListenerexceptionOccurred in class NullProgressListenerexception - The exception to report.public void progress(float percent)
ProgressListenerprogress in interface ProgressListenerprogress in class NullProgressListenerpercent - The progress as a value between 0 and 100 inclusive.public void started()
ProgressListenerstarted in interface ProgressListenerstarted in class NullProgressListenerpublic void warningOccurred(String source, String margin, String warning)
ProgressListenerwarningOccurred in interface ProgressListenerwarningOccurred in class NullProgressListenersource - 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()
ProgressListenergetProgress in interface ProgressListenergetProgress in class NullProgressListenerpublic InternationalString getTask()
ProgressListenernull 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 ProgressListenergetTask in class NullProgressListenernull if none.public void setTask(InternationalString task)
ProgressListenersetTask in interface ProgressListenersetTask in class NullProgressListenertask - 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–2021 Geotools. All rights reserved.