1 |
mojays |
2 |
package appl.data; |
2 |
|
|
|
3 |
|
|
import schmitzm.data.WritableGrid; |
4 |
|
|
|
5 |
|
|
/** |
6 |
|
|
* Defines the base functionality of late loading. Late loading means that the |
7 |
|
|
* data is loaded into memory only when it is accessed (for example by |
8 |
|
|
* <code>getRasterSample(..)</code>-Methods when implemented for |
9 |
|
|
* {@link WritableGrid}s). Notice that this class can be used with any datatype |
10 |
|
|
* (not only grids). |
11 |
|
|
* |
12 |
|
|
* @author Dominik Appl |
13 |
|
|
*/ |
14 |
|
|
public interface LateLoadable { |
15 |
|
|
/** |
16 |
|
|
* Answers if the data type supports late loading |
17 |
|
|
* |
18 |
|
|
* @return true, if late loading is supported |
19 |
|
|
*/ |
20 |
|
|
public boolean isLateLoadable(); |
21 |
|
|
|
22 |
|
|
/** |
23 |
|
|
* Loads the Data into the memory if this function supported. Else it should |
24 |
|
|
* be already loaded |
25 |
|
|
* |
26 |
|
|
* @throws LoadingException |
27 |
|
|
* if the loading fails |
28 |
|
|
*/ |
29 |
|
|
public void loadData() throws LoadingException; |
30 |
|
|
|
31 |
|
|
/** |
32 |
|
|
* Unloads the Data onto disk or into nirvana, depending on implementation. |
33 |
|
|
* Or does nothing, if late loading is not supported. <b>NOTICE</b>: |
34 |
|
|
* UNLOADING DOES NOT MEAN, THAT DATA IS WRITTEN BACK TO THE SOURCE. It may |
35 |
|
|
* be stored in a temporary file for later loading/export, depending on |
36 |
|
|
* implementation. |
37 |
|
|
*/ |
38 |
|
|
public void unloadData(); |
39 |
|
|
|
40 |
|
|
} |