gvsig-raster / org.gvsig.raster.mosaic / trunk / org.gvsig.raster.mosaic / org.gvsig.raster.mosaic.io / src / main / java / org / gvsig / raster / mosaic / io / MosaicRasterFormat.java @ 859
History | View | Annotate | Download (2.5 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
package org.gvsig.raster.mosaic.io; |
23 |
|
24 |
import java.io.File; |
25 |
import java.io.IOException; |
26 |
import java.util.ArrayList; |
27 |
|
28 |
/**
|
29 |
* MosaicFormat information
|
30 |
*
|
31 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
32 |
*/
|
33 |
public class MosaicRasterFormat { |
34 |
public ArrayList<File> fileList = new ArrayList<File>(); |
35 |
private String name = null; |
36 |
private String desc = null; |
37 |
|
38 |
/**
|
39 |
* Gets the name of this serial
|
40 |
* @return
|
41 |
*/
|
42 |
public String getName() { |
43 |
return name;
|
44 |
} |
45 |
|
46 |
/**
|
47 |
* Sets the name of this serie
|
48 |
* @param name
|
49 |
*/
|
50 |
public void setName(String name) { |
51 |
this.name = name;
|
52 |
} |
53 |
|
54 |
/**
|
55 |
* Gets the number of files of this serial
|
56 |
* @return
|
57 |
*/
|
58 |
public int getNumberOfFiles() { |
59 |
return fileList.size();
|
60 |
} |
61 |
|
62 |
/**
|
63 |
* Gets the path of the file in the selected position
|
64 |
* @param file
|
65 |
* @return
|
66 |
*/
|
67 |
public String getPathToFile(int file) { |
68 |
return fileList.get(file).getAbsolutePath();
|
69 |
} |
70 |
|
71 |
/**
|
72 |
* Adds a file to the list
|
73 |
* @param file
|
74 |
*/
|
75 |
public void addFile(File file) { |
76 |
fileList.add(file); |
77 |
} |
78 |
|
79 |
/**
|
80 |
* Cleans the list of files
|
81 |
*/
|
82 |
public void clean() { |
83 |
fileList.clear(); |
84 |
name = null;
|
85 |
} |
86 |
|
87 |
|
88 |
/**
|
89 |
* Sets the description of this serie
|
90 |
* @param desc
|
91 |
*/
|
92 |
public void setDescription(String desc) { |
93 |
this.desc = desc;
|
94 |
} |
95 |
|
96 |
/**
|
97 |
* Gets the description of this serie
|
98 |
* @return
|
99 |
*/
|
100 |
public String getDescription() { |
101 |
return desc;
|
102 |
} |
103 |
|
104 |
/**
|
105 |
* Writes a MosaicFileFormat to disk
|
106 |
* @param file
|
107 |
* @throws IOException
|
108 |
*/
|
109 |
public void write(String fileName) throws IOException { |
110 |
MosaicRasterFormatSerializer.write(this, fileName);
|
111 |
} |
112 |
} |