Statistics
| Revision:

gvsig-raster / org.gvsig.raster.tools / trunk / org.gvsig.raster.tools / org.gvsig.raster.tools.multifile.io / src / main / java / org / gvsig / raster / tools / multifile / io / MultiFileFormat.java @ 859

History | View | Annotate | Download (2.2 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.tools.multifile.io;
23

    
24
import java.io.File;
25
import java.io.IOException;
26
import java.util.ArrayList;
27

    
28
/**
29
 * MultiFileFormat information
30
 * 
31
 * @author Nacho Brodin (nachobrodin@gmail.com)
32
 */
33
public class MultiFileFormat {
34
        public ArrayList<File>   fileList                       = new ArrayList<File>();
35
        private String           name                           = null;
36

    
37
        /**
38
         * Gets the name of this serial
39
         * @return
40
         */
41
        public String getName() {
42
                return name;
43
        }
44
        
45
        /**
46
         * Sets the name of this serie
47
         * @param name
48
         */
49
        public void setName(String name) {
50
                this.name = name;
51
        }
52

    
53
        /**
54
         * Gets the number of files of this serial
55
         * @return
56
         */
57
        public int getNumberOfFiles() {
58
                return fileList.size();
59
        }
60
        
61
        /**
62
         * Gets the path of the file in the selected position
63
         * @param file
64
         * @return
65
         */
66
        public String getPathToFile(int file) {
67
                return fileList.get(file).getAbsolutePath();
68
        }
69
        
70
        /**
71
         * Adds a file to the list
72
         * @param file
73
         */
74
        public void addFile(File file) {
75
                fileList.add(file);
76
        }
77
        
78
        /**
79
         * Cleans the list of files 
80
         */
81
        public void clean() {
82
                fileList.clear();
83
                name = null;
84
        }
85
        
86
        /**
87
         * Writes a MultiFileFormat to disk
88
         * @param file
89
         * @throws IOException
90
         */
91
        public void write(String fileName) throws IOException {
92
                MultiFileFormatSerializer.write(this, fileName);
93
        }
94
}