Package org.geotools.data.util
Class DefaultProgressListener
Object
NullProgressListener
DefaultProgressListener
- All Implemented Interfaces:
 ProgressListener
Default Implementation of 
ProgressListener that does retain exceptions.
 We do not put particular attention on the management of canceled, started, completed, this is a default implementation.
- Since:
 - 2.8
 - Author:
 - Simone Giannecchini, GeoSolutions SAS
 
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCollector class for warnings. - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidcomplete()Notifies this listener that the operation has finished.voiddispose()Releases any resources used by this listener.voidexceptionOccurred(Throwable exception) Reports an exception.Return a copy of theQueueof exceptions that had happened.floatReturns the current progress as a percent completed.getTask()Returns the description of the current task being performed, ornullif none.Retrieves a copy of the warnings occurred.booleanIt tells us if we have exceptions or not.booleanIs the task we are listening is completed.booleanIs the task we are listening for started.voidprogress(float percent) Notifies this listener of progress in the lengthly operation.voidsetTask(InternationalString task) Sets the description of the current task being performed.voidstarted()Notifies this listener that the operation begins.toString()voidwarningOccurred(String source, String margin, String warning) Reports a warning.Methods inherited from class NullProgressListener
getDescription, isCanceled, setCanceled, setDescriptionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ProgressListener
isCanceled, setCanceled 
- 
Constructor Details
- 
DefaultProgressListener
public DefaultProgressListener() 
 - 
 - 
Method Details
- 
toString
 - 
complete
public void complete()Description copied from interface:ProgressListenerNotifies this listener that the operation has finished. The progress indicator will shows 100% or disappears, at implementor choice. If warning messages were pending, they will be displayed now.- Specified by:
 completein interfaceProgressListener- Overrides:
 completein classNullProgressListener
 - 
dispose
public void dispose()Description copied from interface:ProgressListenerReleases any resources used by this listener. If the progress were reported in a window, this window may be disposed.- Specified by:
 disposein interfaceProgressListener- Overrides:
 disposein classNullProgressListener
 - 
exceptionOccurred
Description copied from interface:ProgressListenerReports an exception. This method may prints the stack trace to the standard error stream or display it in a dialog box, at implementor choice.- Specified by:
 exceptionOccurredin interfaceProgressListener- Overrides:
 exceptionOccurredin classNullProgressListener- Parameters:
 exception- The exception to report.
 - 
progress
public void progress(float percent) Description copied from interface:ProgressListenerNotifies this listener of progress in the lengthly operation. Progress are reported as a value between 0 and 100 inclusive. Values out of bounds will be clamped.- Specified by:
 progressin interfaceProgressListener- Overrides:
 progressin classNullProgressListener- Parameters:
 percent- The progress as a value between 0 and 100 inclusive.
 - 
started
public void started()Description copied from interface:ProgressListenerNotifies this listener that the operation begins.- Specified by:
 startedin interfaceProgressListener- Overrides:
 startedin classNullProgressListener
 - 
warningOccurred
Description copied from interface:ProgressListenerReports a warning. This warning may be logged, printed to the standard error stream, appears in a windows or be ignored, at implementor choice.- Specified by:
 warningOccurredin interfaceProgressListener- Overrides:
 warningOccurredin classNullProgressListener- Parameters:
 source- Name of the warning source, ornullif 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, ornullif none. This is typically the line number where the error occured in thesourcefile or the feature ID of the feature that produced the messagewarning- The warning message.
 - 
getProgress
public float getProgress()Description copied from interface:ProgressListenerReturns the current progress as a percent completed.- Specified by:
 getProgressin interfaceProgressListener- Overrides:
 getProgressin classNullProgressListener- Returns:
 - Percent completed between 0 and 100 inclusive.
 
 - 
getTask
Description copied from interface:ProgressListenerReturns the description of the current task being performed, ornullif none. It is assumed that if the task isnullapplications may simply report that the process is "in progress" or "working" as represented in the current locale.- Specified by:
 getTaskin interfaceProgressListener- Overrides:
 getTaskin classNullProgressListener- Returns:
 - Description of the task being performed, or 
nullif none. 
 - 
setTask
Description copied from interface:ProgressListenerSets the description of the current task being performed. This method is usually invoked before any progress begins. However, it is legal to invoke this method at any time during the operation, in which case the description display is updated without any change to the percentage accomplished.- Specified by:
 setTaskin interfaceProgressListener- Overrides:
 setTaskin classNullProgressListener- Parameters:
 task- Description of the task being performed, ornullif none.
 - 
isCompleted
public boolean isCompleted()Is the task we are listening is completed.- Returns:
 trueif the task is completed,falseif it is not.
 - 
getExceptions
Return a copy of theQueueof exceptions that had happened.- Returns:
 - a copy of the 
Queueof exceptions that had happened. 
 - 
hasExceptions
public boolean hasExceptions()It tells us if we have exceptions or not.- Returns:
 trueif there are exceptions,falseotherwise.
 - 
isStarted
public boolean isStarted()Is the task we are listening for started.- Returns:
 trueif the task is started,falseif it is not.
 - 
getWarnings
Retrieves a copy of the warnings occurred.- Returns:
 - a copy of the warnings occurred.
 
 
 -