Statistics
| Revision:

gvsig-raster / org.gvsig.raster / trunk / org.gvsig.raster / org.gvsig.raster.lib / org.gvsig.raster.lib.impl / src / main / java / org / gvsig / raster / impl / store / properties / DataStoreSerialInfo.java @ 162

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.impl.store.properties;
23

    
24
import java.util.ArrayList;
25

    
26
import org.gvsig.fmap.dal.coverage.store.props.SerialInfo;
27
import org.gvsig.raster.impl.datastruct.TimeInfo;
28
/**
29
 * DataStore serial information
30
 * 
31
 * @author Nacho Brodin (nachobrodin@gmail.com)
32
 */
33
public class DataStoreSerialInfo implements SerialInfo {
34
        private ArrayList<TimeInfo>  serial = new ArrayList<TimeInfo>(); 
35

    
36
        /**
37
         * Constructor vacio. 
38
         */
39
        public DataStoreSerialInfo() {
40
        }
41
        
42
        /**
43
         * Counts the number of serials
44
         * @return
45
         */
46
        public int getNumberOfSerials() {
47
                return serial.size();
48
        }
49
        
50
        /**
51
         * Gets the serial with then name selected
52
         * @param name
53
         * @return
54
         */
55
        public TimeInfo getSerial(String name) {
56
                for (int i = 0; i < serial.size(); i++) {
57
                        if(serial.get(i).getSerialName().compareTo(name) == 0)
58
                                return serial.get(i);
59
                }
60
                return null;
61
        }
62
        
63
        /**
64
         * Gets the serial with then name selected
65
         * @param name
66
         * @return
67
         */
68
        public TimeInfo getSerial(int pos) {
69
                return serial.get(pos);
70
        }
71
        
72
        /**
73
         * Sets the serial information
74
         * @param serial
75
         */
76
        public void setSerial(ArrayList<TimeInfo> serial) {
77
                this.serial = serial;
78
        }
79
        
80
        /**
81
         * Gets the description
82
         * @return
83
         */
84
        public String getDescription() {
85
                if(serial.size() == 0)
86
                        return null;
87
                else 
88
                        return serial.get(0).getDescription();
89
        }
90
}