Statistics
| Revision:

gvsig-raster / org.gvsig.raster.cache / trunk / org.gvsig.raster.cache / org.gvsig.raster.cache.lib.api / src / main / java / org / gvsig / raster / cache / buffer / BufferDataSource.java @ 991

History | View | Annotate | Download (3.62 KB)

1
package org.gvsig.raster.cache.buffer;
2

    
3
import java.io.IOException;
4

    
5
import org.gvsig.raster.cache.buffer.Band;
6
import org.gvsig.raster.cache.buffer.Buffer;
7
import org.gvsig.raster.cache.buffer.exception.OperationNotSupportedException;
8

    
9

    
10
/**
11
 * Data Server for read only buffers. 
12
 * 02/11/2008
13
 * @author Nacho Brodin (nachobrodin@gmail.com)
14
 */
15
public interface BufferDataSource {
16
        /**
17
         * Get the path to image file
18
         * @return
19
         */
20
        public String getPath();
21
        
22
        /**
23
         * Set the path to image file
24
         * @param  path
25
         *         path to the file
26
         */
27
        public void setPath(String path);
28
        
29
        /**
30
         * Get the band selected to read for loadSelectedBand method
31
         * @return
32
         */
33
        public int getSelectedBand();
34
        
35
        /**
36
         * Set the band selected to read for loadSelectedBand method
37
         * @param  band
38
         *         band to the file
39
         */
40
        public void setSelectedBand(int path);
41
        
42
        /**
43
         * Get the width of the data source
44
         * @return
45
         */
46
        public int getWidth();
47
        
48
        /**
49
         * Get the height of the data source
50
         * @return
51
         */
52
        public int getHeight();
53
        
54
        /**
55
         * Get de number of bands
56
         * @return
57
         */
58
        public int getBandCount();
59
        
60
        /**
61
         * Get the data type
62
         * @return
63
         */
64
        public int getDataType();
65

    
66
        /**
67
         * Load a page with data. 
68
         * @param  rb
69
         *         Page 
70
         * @param  stripe
71
         *         Object with the information about data read. This contains positional information.
72
         * @throws IOException
73
         * @throws InterruptedException
74
         * @throws OperationNotSupportedException
75
         */
76
        public void loadPage(Buffer rb, PxTile stripe) throws IOException, InterruptedException, OperationNotSupportedException;
77
        
78
        /**
79
         * Load a one banded page with data. 
80
         * @param  rb
81
         *         Page 
82
         * @param  stripe
83
         *         Object with the information about data read. This contains positional information.
84
         * @param  iBand
85
         *         Band to load
86
         * @throws IOException
87
         * @throws InterruptedException
88
         * @throws OperationNotSupportedException
89
         */
90
        public void loadPage(Buffer rb, PxTile stripe, int iBand) throws IOException, InterruptedException, OperationNotSupportedException;
91
        
92
        /**
93
         * Load a page with data. Only is loaded the band selected in the variable "selectedBand" 
94
         * @param  rb
95
         *         Page 
96
         * @param  stripe
97
         *         Object with the information about data read. This contains positional information.
98
         * @throws IOException
99
         * @throws InterruptedException
100
         * @throws OperationNotSupportedException
101
         */
102
        public void loadSelectedBand(Buffer rb, PxTile stripe) throws IOException, InterruptedException, OperationNotSupportedException;
103
        
104
        /**
105
         * Load a page of cache from the hard disk
106
         * @param RasterMemoryBuffer Data buffer to load in memory 
107
         * @param String File name
108
         */
109
        public void loadPage(Buffer buf, String file) throws InterruptedException;
110
        
111
        /**
112
         * Save a page of cache to the hard disk   
113
         * @param RasterMemoryBuffer Data buffer to load in memory 
114
         * @param String File name
115
         * @throws IOException
116
         */
117
        public void savePage(Buffer buf, String file)throws IOException;
118
        
119
        /**
120
         * Save a band of cache to the hard disk   
121
         * @param RasterMemoryBuffer Data buffer to load in memory 
122
         * @param String File name
123
         * @throws IOException
124
         */
125
        public void saveBand(Band buf, String file)throws IOException;
126
        
127
        /**
128
         * Elimina la fuente de datos de disco
129
         * @throws IOException
130
         */
131
        public void delete(String file)throws IOException;
132
        
133
        /**
134
         * Close the data source
135
         */
136
        public void close() throws IOException;
137
        
138
        /**
139
         * Change the name of a file
140
         * @param oldName
141
         * @param newName
142
         */
143
        public void changeFileName(String oldName, String newName);
144
        
145
        /**
146
         * Clone the datasource to be assigned to each band
147
         * @return
148
         */
149
        public BufferDataSource clone();
150
}