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