svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.metadata.basic / org.gvsig.metadata.basic.lib / org.gvsig.metadata.lib.basic.api / src / main / java / org / gvsig / metadata / DefinitionsMap.java @ 40608
History | View | Annotate | Download (4.54 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
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 2
|
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 |
*/
|
22 |
|
23 |
/*
|
24 |
* AUTHORS (In addition to CIT):
|
25 |
* 2011 Geographic Information research group: http://www.geoinfo.uji.es
|
26 |
* Departamento de Lenguajes y Sistemas Informaticos (LSI)
|
27 |
* Universitat Jaume I
|
28 |
*/
|
29 |
package org.gvsig.metadata; |
30 |
|
31 |
import java.util.Iterator; |
32 |
import java.util.List; |
33 |
import java.util.Map; |
34 |
|
35 |
import org.gvsig.tools.dispose.DisposableIterator; |
36 |
import org.gvsig.tools.dynobject.DynField; |
37 |
import org.gvsig.tools.dynobject.DynStruct; |
38 |
|
39 |
/**
|
40 |
*
|
41 |
* This is the intermediary of the ImportExport module, which enables to have a
|
42 |
* disposable iterator of a list of DynStructs. It also permits to obtain
|
43 |
* another disposable iterator of the related DynFields based on a given
|
44 |
* DynStruct. It extends from a Map<String, DynStruct>.
|
45 |
*
|
46 |
*
|
47 |
* @author gvSIG Team
|
48 |
* @author <a href="mailto:reinhold@uji.es">cmartin</a>
|
49 |
* @version $Id$
|
50 |
*
|
51 |
*/
|
52 |
public interface DefinitionsMap extends Map { |
53 |
|
54 |
|
55 |
/**
|
56 |
* Removes a definition from the list
|
57 |
*
|
58 |
* @param definition
|
59 |
* the definition to be removed.
|
60 |
*/
|
61 |
public void remove(DynStruct definition); |
62 |
|
63 |
/**
|
64 |
* Adds a definition to the list
|
65 |
*
|
66 |
* @param definition
|
67 |
* the definition to be added.
|
68 |
*/
|
69 |
public void add(DynStruct newDefinition); |
70 |
|
71 |
public void addAll(Map map); |
72 |
|
73 |
/**
|
74 |
* Determines if this definition is already included.
|
75 |
*
|
76 |
* @param definition
|
77 |
* the current definition to be checked.
|
78 |
* @return true if the definition is contained, false otherwise.
|
79 |
*/
|
80 |
public boolean hasDefinition(DynStruct definition); |
81 |
|
82 |
/**
|
83 |
* Saves the current Metadata elements of the list.
|
84 |
*
|
85 |
*/
|
86 |
public void save(); |
87 |
|
88 |
/**
|
89 |
* Retrieves the size of the list of elements.
|
90 |
*/
|
91 |
public int size(); |
92 |
|
93 |
/**
|
94 |
* Sets the current user definitions linked to the current hierarchy
|
95 |
* definitions.
|
96 |
*
|
97 |
* @param userDefs
|
98 |
* the user Definitions
|
99 |
* @param hierarchyDefs
|
100 |
* the hierarchy Definitions
|
101 |
*/
|
102 |
public void setHierarchyDefinitions(Map userDefs, Map hierarchyDefs); |
103 |
|
104 |
/**
|
105 |
* Returns a list containing definitions ( {@link DynStruct} ), which are
|
106 |
* disposable.
|
107 |
*
|
108 |
* @return the disposable DynStructs iterator.
|
109 |
*/
|
110 |
public Iterator iterator(); |
111 |
|
112 |
/**
|
113 |
* Returns a disposable list iteration containing {@link DynField}s based on
|
114 |
* a given definition ( {@link DynStruct} ).
|
115 |
*
|
116 |
* @param definition
|
117 |
* the DynStruct definition from which to obtain the associated
|
118 |
* DynFields.
|
119 |
* @return the disposable DynFields iterator.
|
120 |
*/
|
121 |
public DisposableIterator dynFieldsIterator(DynStruct definition);
|
122 |
|
123 |
/**
|
124 |
* Returns a list containing children definitions ({@link DynStruct}s) based
|
125 |
* on a given definition.
|
126 |
*
|
127 |
* @param definition
|
128 |
* the DynStruct definition from which to obtain the associated
|
129 |
* children.
|
130 |
* @return the disposable DynFields iterator.
|
131 |
*/
|
132 |
public List getChildren(DynStruct definition); |
133 |
|
134 |
/**
|
135 |
* Returns a disposable list iteration containing the current elements of
|
136 |
* the list.
|
137 |
*
|
138 |
* @return the disposable DynFields iterator.
|
139 |
*/
|
140 |
public DisposableIterator disposableIterator();
|
141 |
|
142 |
/**
|
143 |
* Returns a list iteration containing the current parent element
|
144 |
* definitions of a given childDefinition.
|
145 |
*
|
146 |
* @param childDefinition
|
147 |
* @return the parent definitions' iterator.
|
148 |
*/
|
149 |
public Iterator parentsIterator(DynStruct childDefinition); |
150 |
|
151 |
/**
|
152 |
* Returns a list iteration containing the current children element
|
153 |
* definitions of a given parentDefinition.
|
154 |
*
|
155 |
* @return the parent definitions' iterator.
|
156 |
*/
|
157 |
public Iterator childrenIterator(DynStruct parentDefinition); |
158 |
|
159 |
} |