1 |
mojays |
2 |
package appl.data; |
2 |
|
|
|
3 |
|
|
import schmitzm.data.WritableGrid; |
4 |
|
|
import schmitzm.data.WritableGridArray; |
5 |
|
|
import appl.util.RasterMetaData; |
6 |
|
|
|
7 |
|
|
/** |
8 |
|
|
* Simply loads an empty {@link WritableGridArray} with the specified meta data. |
9 |
|
|
* |
10 |
|
|
* @author Dominik Appl |
11 |
|
|
*/ |
12 |
|
|
public class WritableGridArrayLoader implements DataLoader { |
13 |
|
|
|
14 |
|
|
private RasterMetaData metaData; |
15 |
|
|
|
16 |
|
|
private WritableGridArrayLoader() { |
17 |
|
|
} |
18 |
|
|
|
19 |
|
|
/** |
20 |
|
|
* @param metaData |
21 |
|
|
* the metadata with the exact dimensions/datatype |
22 |
|
|
*/ |
23 |
|
|
public WritableGridArrayLoader(RasterMetaData metaData) { |
24 |
|
|
this.metaData = metaData; |
25 |
|
|
} |
26 |
|
|
|
27 |
|
|
/* |
28 |
|
|
* (non-Javadoc) |
29 |
|
|
* |
30 |
|
|
* @see appl.data.DataLoader#load() |
31 |
|
|
*/ |
32 |
|
|
public WritableGrid load() { |
33 |
|
|
return WritableGridArray.createEmpty(metaData); |
34 |
|
|
} |
35 |
|
|
|
36 |
|
|
/* |
37 |
|
|
* (non-Javadoc) |
38 |
|
|
* |
39 |
|
|
* @see appl.data.DataLoader#getLoadInfo() |
40 |
|
|
*/ |
41 |
|
|
public String getLoadInfo() { |
42 |
|
|
return "WritableGridArrayLoader|" + metaData; |
43 |
|
|
} |
44 |
|
|
|
45 |
|
|
} |