/[xulu]/trunk/src/appl/parallel/data/xulugridfile/GridFileDataLoader.java
ViewVC logotype

Annotation of /trunk/src/appl/parallel/data/xulugridfile/GridFileDataLoader.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (hide annotations)
Wed Feb 25 11:54:01 2009 UTC (15 years, 9 months ago) by mojays
File size: 1368 byte(s)
First Commit, corresponds to Revision 1008 of Wikisquare-SVN 
1 mojays 2 package appl.parallel.data.xulugridfile;
2    
3     import schmitzm.data.WritableGrid;
4     import appl.data.DataLoader;
5     import appl.data.LoadingException;
6    
7     /**
8     * This {@link DataLoader} is responsible to load data from a
9     * {@link XuluGridFile}. When {@link #load()} is called it tries to load the
10     * whole(!) grid into the memory. Notice that using this loader will destroy all
11     * memory advantages of the {@link XuluGridFile}. It is intended as standard loader in
12     * the xulu application. The user can therefore force the loading of the grid
13     * into the local memory e.g. for visualization.
14     *
15     * @author Dominik Appl
16     */
17     public class GridFileDataLoader implements DataLoader {
18    
19     private final XuluGridFile gridFile;
20    
21     public GridFileDataLoader(XuluGridFile gridFile) {
22     this.gridFile = gridFile;
23     }
24    
25     /* (non-Javadoc)
26     * @see appl.data.DataLoader#getLoadInfo()
27     */
28     public String getLoadInfo() {
29     // TODO Auto-generated method stub
30     return "Loading gridfile " + gridFile.getOutputFile().getPath() + ". ";
31     }
32    
33     /** loads the whole grid into memory and returns it
34     * @see appl.data.DataLoader#load()
35     */
36     public WritableGrid load() throws LoadingException {
37     try {
38     return gridFile.getWholeGrid();
39     } catch (XuluGridFileException e) {
40     // TODO Auto-generated catch block
41     e.printStackTrace();
42     }
43     return null;
44     }
45    
46     }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26