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 @ 1023
History | View | Annotate | Download (3.76 KB)
1 |
package org.gvsig.raster.cache.buffer; |
---|---|
2 |
|
3 |
import java.io.IOException; |
4 |
|
5 |
import org.gvsig.raster.cache.buffer.exception.OperationNotSupportedException; |
6 |
import org.gvsig.raster.cache.buffer.exception.ProcessInterruptedException; |
7 |
|
8 |
|
9 |
/**
|
10 |
* Data Server for read only buffers.
|
11 |
* 02/11/2008
|
12 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
13 |
*/
|
14 |
public interface BufferDataSource { |
15 |
/**
|
16 |
* Get the path to image file
|
17 |
* @return
|
18 |
*/
|
19 |
public String[] getPath(); |
20 |
|
21 |
/**
|
22 |
* Set the path to image file
|
23 |
* @param path
|
24 |
* path to the file
|
25 |
*/
|
26 |
public void setPath(String[] path); |
27 |
|
28 |
/**
|
29 |
* Set the path to image file
|
30 |
* @param path
|
31 |
* path to the file
|
32 |
*/
|
33 |
public void setPath(String path); |
34 |
|
35 |
/**
|
36 |
* Get the band selected to read for loadSelectedBand method
|
37 |
* @return
|
38 |
*/
|
39 |
public int getSelectedBand(); |
40 |
|
41 |
/**
|
42 |
* Set the band selected to read for loadSelectedBand method
|
43 |
* @param band
|
44 |
* band to the file
|
45 |
*/
|
46 |
public void setSelectedBand(int path); |
47 |
|
48 |
/**
|
49 |
* Get the width of the data source
|
50 |
* @return
|
51 |
*/
|
52 |
public int getWidth(); |
53 |
|
54 |
/**
|
55 |
* Get the height of the data source
|
56 |
* @return
|
57 |
*/
|
58 |
public int getHeight(); |
59 |
|
60 |
/**
|
61 |
* Get de number of bands
|
62 |
* @return
|
63 |
*/
|
64 |
public int getBandCount(); |
65 |
|
66 |
/**
|
67 |
* Get the data type
|
68 |
* @return
|
69 |
*/
|
70 |
public int getDataType(); |
71 |
|
72 |
/**
|
73 |
* Load a page with data.
|
74 |
* @param rb
|
75 |
* Page
|
76 |
* @param stripe
|
77 |
* Object with the information about data read. This contains positional information.
|
78 |
* @throws IOException
|
79 |
* @throws InterruptedException
|
80 |
* @throws OperationNotSupportedException
|
81 |
*/
|
82 |
public void loadPage(Buffer rb, PxTile stripe) throws IOException, ProcessInterruptedException, OperationNotSupportedException; |
83 |
|
84 |
/**
|
85 |
* Load a one banded page with data.
|
86 |
* @param rb
|
87 |
* Page
|
88 |
* @param stripe
|
89 |
* Object with the information about data read. This contains positional information.
|
90 |
* @param iBand
|
91 |
* Band to load
|
92 |
* @throws IOException
|
93 |
* @throws InterruptedException
|
94 |
* @throws OperationNotSupportedException
|
95 |
*/
|
96 |
public void loadPage(Buffer rb, PxTile stripe, int iBand) throws IOException, ProcessInterruptedException, OperationNotSupportedException; |
97 |
|
98 |
/**
|
99 |
* Load a page with data. Only is loaded the band selected in the variable "selectedBand"
|
100 |
* @param rb
|
101 |
* Page
|
102 |
* @param stripe
|
103 |
* Object with the information about data read. This contains positional information.
|
104 |
* @throws IOException
|
105 |
* @throws OperationNotSupportedException
|
106 |
* @throws ProcessInterruptedException
|
107 |
*/
|
108 |
public void loadSelectedBand(Buffer rb, PxTile stripe) throws IOException, OperationNotSupportedException, ProcessInterruptedException; |
109 |
|
110 |
/**
|
111 |
* Load a page of cache from the hard disk
|
112 |
* @param RasterMemoryBuffer Data buffer to load in memory
|
113 |
* @param String File name
|
114 |
*/
|
115 |
public void loadPage(Buffer buf, String file) throws InterruptedException; |
116 |
|
117 |
/**
|
118 |
* Save a page of cache to the hard disk
|
119 |
* @param RasterMemoryBuffer Data buffer to load in memory
|
120 |
* @param String File name
|
121 |
* @throws IOException
|
122 |
*/
|
123 |
public void savePage(Buffer buf, String file)throws IOException; |
124 |
|
125 |
/**
|
126 |
* Save a band of cache to the hard disk
|
127 |
* @param RasterMemoryBuffer Data buffer to load in memory
|
128 |
* @param String File name
|
129 |
* @throws IOException
|
130 |
*/
|
131 |
public void saveBand(Band buf, String file)throws IOException; |
132 |
|
133 |
/**
|
134 |
* Elimina la fuente de datos de disco
|
135 |
* @throws IOException
|
136 |
*/
|
137 |
public void delete(String file)throws IOException; |
138 |
|
139 |
/**
|
140 |
* Close the data source
|
141 |
*/
|
142 |
public void close() throws IOException; |
143 |
|
144 |
/**
|
145 |
* Change the name of a file
|
146 |
* @param oldName
|
147 |
* @param newName
|
148 |
*/
|
149 |
public void changeFileName(String oldName, String newName); |
150 |
|
151 |
/**
|
152 |
* Clone the datasource to be assigned to each band
|
153 |
* @return
|
154 |
*/
|
155 |
public BufferDataSource clone();
|
156 |
} |