svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.impl / src / main / java / org / gvsig / fmap / dal / feature / impl / expansionadapter / ExpansionAdapter.java @ 40559
History | View | Annotate | Download (3.3 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
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 3
|
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 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.fmap.dal.feature.impl.expansionadapter; |
25 |
|
26 |
import java.util.HashMap; |
27 |
import java.util.Iterator; |
28 |
|
29 |
|
30 |
/**
|
31 |
* Maneja el fichero de extensi?n en el que se almacenan las modificacionesy adici?nes
|
32 |
* durante la edici?n. Los ?ndices que devuelve esta clase en sus m?todos
|
33 |
* addFeature y modifyFeature son invariables, es decir, que si se invoca un
|
34 |
* m?todo addFeature que retorna un 8, independientemente de las operaciones
|
35 |
* que se realicen posteriormente, una llamada a getFeature(8) retornar?
|
36 |
* dicha fila. Si esta geometr?a es eliminada posteriormente, se retornar? un
|
37 |
* null. Esto ?ltimo se cumple mientras no se invoque el m?todo compact, mediante
|
38 |
* el que se reorganizan las geometr?as dejando en el fichero s?lo las que tienen
|
39 |
* validez en el momento de realizar la invocaci?n.
|
40 |
*
|
41 |
* @author Vicente Caballero Navarro
|
42 |
*
|
43 |
*/
|
44 |
public interface ExpansionAdapter { |
45 |
/**
|
46 |
* A?ade una geometria al final del fichero y retorna el ?ndice que ocupa
|
47 |
* esta geometria en el mismo
|
48 |
*
|
49 |
* @param feature
|
50 |
* @param status TODO
|
51 |
* @param indexInternalFields fields that where valid when this feature was added.
|
52 |
*
|
53 |
* @return calculated index of the new feature.
|
54 |
*/
|
55 |
int addObject(Object obj); |
56 |
|
57 |
/**
|
58 |
* Modifica la index-?sima geometr?a del fichero devolviendo la posici?n en
|
59 |
* la que se pone la geometria modificada.
|
60 |
*
|
61 |
* @param calculated index of feature to be modified
|
62 |
* @param feature newFeature that replaces the old feature.
|
63 |
*
|
64 |
* @return new calculated index of the modified feature.
|
65 |
*/
|
66 |
// int updateObject(Object obj);
|
67 |
|
68 |
/**
|
69 |
* Obtiene la geometria que hay en el ?ndice 'index' o null si la geometr?a
|
70 |
* ha sido invalidada.
|
71 |
*
|
72 |
* @param index caculatedIndex of the feature to be read.
|
73 |
* @return feature
|
74 |
*/
|
75 |
Object getObject(int index); |
76 |
|
77 |
/**
|
78 |
* Realiza una compactaci?n del fichero que maneja esta clase
|
79 |
*
|
80 |
* @param relations DOCUMENT ME!
|
81 |
*/
|
82 |
void compact(HashMap relations); |
83 |
|
84 |
/**
|
85 |
* Mueve el puntero de escritura de manera que las siguientes escrituras
|
86 |
* machacar?n la ?ltima fila
|
87 |
*/
|
88 |
void deleteLastObject();
|
89 |
|
90 |
/**
|
91 |
* Abre el fichero de expansi?n para comenzar la edici?n
|
92 |
*/
|
93 |
void open();
|
94 |
|
95 |
/**
|
96 |
* Cierra el fichero de expansi?n al terminar la edici?n
|
97 |
*/
|
98 |
void close();
|
99 |
|
100 |
int getSize();
|
101 |
|
102 |
Iterator iterator();
|
103 |
} |