svn-gvsig-desktop / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / edition / ExpansionFile.java @ 6326
History | View | Annotate | Download (2.96 KB)
1 |
package com.iver.cit.gvsig.fmap.edition; |
---|---|
2 |
|
3 |
import com.iver.cit.gvsig.fmap.core.IRow; |
4 |
|
5 |
import java.io.IOException; |
6 |
|
7 |
import java.util.BitSet; |
8 |
import java.util.HashMap; |
9 |
|
10 |
|
11 |
/**
|
12 |
* Maneja el fichero de extensi?n en el que se almacenan las modificacionesy adici?nes
|
13 |
* durante la edici?n. Los ?ndices que devuelve esta clase en sus m?todos
|
14 |
* addRow y modifyRow son invariables, es decir, que si se invoca un
|
15 |
* m?todo addRow que retorna un 8, independientemente de las operaciones
|
16 |
* que se realicen posteriormente, una llamada a getRow(8) retornar?
|
17 |
* dicha fila. Si esta geometr?a es eliminada posteriormente, se retornar? un
|
18 |
* null. Esto ?ltimo se cumple mientras no se invoque el m?todo compact, mediante
|
19 |
* el que se reorganizan las geometr?as dejando en el fichero s?lo las que tienen
|
20 |
* validez en el momento de realizar la invocaci?n.
|
21 |
*/
|
22 |
public interface ExpansionFile { |
23 |
/**
|
24 |
* A?ade una geometria al final del fichero y retorna el ?ndice que ocupa
|
25 |
* esta geometria en el mismo
|
26 |
*
|
27 |
* @param row DOCUMENT ME!
|
28 |
* @param status TODO
|
29 |
* @param indexInternalFields fields that where valid when this row was added.
|
30 |
*
|
31 |
* @return calculated index of the new row.
|
32 |
*
|
33 |
* @throws IOException
|
34 |
*/
|
35 |
int addRow(IRow row, int status, int indexInternalFields) throws IOException; |
36 |
|
37 |
/**
|
38 |
* Modifica la index-?sima geometr?a del fichero devolviendo la posici?n en
|
39 |
* la que se pone la geometria modificada.
|
40 |
*
|
41 |
* @param calculated index of row to be modified
|
42 |
* @param row newRow that replaces the old row.
|
43 |
*
|
44 |
* @return new calculated index of the modified row.
|
45 |
*
|
46 |
* @throws IOException
|
47 |
*/
|
48 |
int modifyRow(int index, IRow row, int indexInternalFields) throws IOException; |
49 |
|
50 |
/**
|
51 |
* Obtiene la geometria que hay en el ?ndice 'index' o null si la geometr?a
|
52 |
* ha sido invalidada.
|
53 |
*
|
54 |
* @param index caculatedIndex of the row to be read.
|
55 |
* @return
|
56 |
* @throws IOException
|
57 |
*/
|
58 |
IRowEdited getRow(int index) throws IOException; |
59 |
|
60 |
/**
|
61 |
* Invalida una geometr?a, de cara a una futura compactaci?n del fichero
|
62 |
*
|
63 |
* @param index DOCUMENT ME!
|
64 |
*/
|
65 |
//void invalidateRow(int index);
|
66 |
|
67 |
/**
|
68 |
* Realiza una compactaci?n del fichero que maneja esta clase
|
69 |
*
|
70 |
* @param relations DOCUMENT ME!
|
71 |
*/
|
72 |
void compact(HashMap relations); |
73 |
|
74 |
/**
|
75 |
* Devuelve el n?mero de geometr?as del fichero.
|
76 |
*
|
77 |
* @return n?mero de geometr?as.
|
78 |
*/
|
79 |
//int getRowCount();
|
80 |
|
81 |
/**
|
82 |
* Mueve el puntero de escritura de manera que las siguientes escrituras
|
83 |
* machacar?n la ?ltima fila
|
84 |
*/
|
85 |
void deleteLastRow();
|
86 |
|
87 |
/**
|
88 |
* Abre el fichero de expansi?n para comenzar la edici?n
|
89 |
*
|
90 |
* @throws IOException Si se produce alg?n error al abrir
|
91 |
*/
|
92 |
void open() throws IOException; |
93 |
|
94 |
/**
|
95 |
* Cierra el fichero de expansi?n al terminar la edici?n
|
96 |
*
|
97 |
* @throws IOException Si se produce alg?n error
|
98 |
*/
|
99 |
void close() throws IOException; |
100 |
|
101 |
/**
|
102 |
* @param previousExpansionFileIndex
|
103 |
*/
|
104 |
//void validateRow(int previousExpansionFileIndex);
|
105 |
//BitSet getInvalidRows();
|
106 |
|
107 |
int getSize();
|
108 |
} |