Last change
on this file since 9983 was 9983, checked in by Don-vip, 8 years ago |
remove unused code
|
-
Property svn:eol-style
set to
native
|
File size:
1.1 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.cache;
|
---|
3 |
|
---|
4 | import java.io.IOException;
|
---|
5 | import java.net.URL;
|
---|
6 |
|
---|
7 | /**
|
---|
8 | *
|
---|
9 | * @author Wiktor Niesiobędzki
|
---|
10 | *
|
---|
11 | * @param <K> cache key type
|
---|
12 | */
|
---|
13 | public interface ICachedLoaderJob<K> extends Runnable {
|
---|
14 | /**
|
---|
15 | * returns cache entry key
|
---|
16 | *
|
---|
17 | * @return cache key for tile
|
---|
18 | */
|
---|
19 | K getCacheKey();
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * method to get download URL for Job
|
---|
23 | * @return URL that should be fetched
|
---|
24 | * @throws IOException when could not determine the URL of the tile
|
---|
25 | *
|
---|
26 | */
|
---|
27 | URL getUrl() throws IOException;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * fetches object from cache, or returns null when object is not found
|
---|
31 | *
|
---|
32 | * @return filled tile with data or null when no cache entry found
|
---|
33 | */
|
---|
34 | CacheEntry get();
|
---|
35 |
|
---|
36 | /**
|
---|
37 | * Submit job for background fetch, and listener will be fed with value object
|
---|
38 | *
|
---|
39 | * @param listener cache loader listener
|
---|
40 | * @param force true if the load should skip all the caches (local & remote)
|
---|
41 | * @throws IOException on failure from getUrl() call
|
---|
42 | */
|
---|
43 | void submit(ICachedLoaderListener listener, boolean force) throws IOException;
|
---|
44 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.