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