Ignore:
Timestamp:
2017-11-12T00:37:00+01:00 (7 years ago)
Author:
donvip
Message:

see #josm15539 - add a new method to ease asynchronous testing (patch by ris)

Location:
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java

    r33431 r33804  
    178178
    179179    @Override
     180    public boolean hasOutstandingTasks() {
     181        return jobDispatcher.getTaskCount() > jobDispatcher.getCompletedTaskCount();
     182    }
     183
     184    @Override
    180185    public void cancelOutstandingTasks() {
    181186        jobDispatcher.getQueue().clear();
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/TileLoader.java

    r31540 r33804  
    2727     */
    2828    void cancelOutstandingTasks();
     29
     30    /**
     31     * Determines whether this {@link TileLoader} has tasks which have not completed.
     32     * @return whether this {@link TileLoader} has tasks which have not completed. This answer may well be
     33     * "approximate" given that many implementations will be using mechanisms where a queue's state can change
     34     * during the computation.
     35     */
     36    default boolean hasOutstandingTasks() {
     37        // default implementation supplied just to make transition easier for external implementors
     38        throw new UnsupportedOperationException("Not implemented");
     39    }
    2940}
Note: See TracChangeset for help on using the changeset viewer.