1 |
9479da48
|
Andreas Müller
|
/**
|
2 |
|
|
* Copyright (C) 2007 EDIT
|
3 |
3dd6c00e
|
Andreas Müller
|
* European Distributed Institute of Taxonomy
|
4 |
9479da48
|
Andreas Müller
|
* http://www.e-taxonomy.eu
|
5 |
3dd6c00e
|
Andreas Müller
|
*
|
6 |
9479da48
|
Andreas Müller
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7 |
|
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8 |
|
|
*/
|
9 |
|
|
|
10 |
|
|
package eu.etaxonomy.cdm.model.description;
|
11 |
|
|
|
12 |
17f0cc4b
|
h.fradin
|
import java.util.HashSet;
|
13 |
|
|
import java.util.Set;
|
14 |
a2a36ad5
|
ben.clark
|
|
15 |
17f0cc4b
|
h.fradin
|
import javax.persistence.Entity;
|
16 |
|
|
import javax.persistence.FetchType;
|
17 |
|
|
import javax.persistence.JoinTable;
|
18 |
|
|
import javax.persistence.ManyToMany;
|
19 |
96be23fc
|
Andreas Müller
|
import javax.persistence.OneToMany;
|
20 |
a641fad9
|
ben.clark
|
import javax.validation.constraints.NotNull;
|
21 |
01b7ddbf
|
a.babadshanjan
|
import javax.xml.bind.annotation.XmlAccessType;
|
22 |
|
|
import javax.xml.bind.annotation.XmlAccessorType;
|
23 |
|
|
import javax.xml.bind.annotation.XmlElement;
|
24 |
|
|
import javax.xml.bind.annotation.XmlElementWrapper;
|
25 |
|
|
import javax.xml.bind.annotation.XmlIDREF;
|
26 |
|
|
import javax.xml.bind.annotation.XmlRootElement;
|
27 |
|
|
import javax.xml.bind.annotation.XmlSchemaType;
|
28 |
|
|
import javax.xml.bind.annotation.XmlType;
|
29 |
9479da48
|
Andreas Müller
|
|
30 |
17f0cc4b
|
h.fradin
|
import org.apache.log4j.Logger;
|
31 |
a641fad9
|
ben.clark
|
import org.hibernate.annotations.Cascade;
|
32 |
|
|
import org.hibernate.annotations.CascadeType;
|
33 |
17f0cc4b
|
h.fradin
|
import org.hibernate.envers.Audited;
|
34 |
|
|
|
35 |
533cbb43
|
Andreas Müller
|
import eu.etaxonomy.cdm.model.common.DefinedTerm;
|
36 |
17f0cc4b
|
h.fradin
|
import eu.etaxonomy.cdm.model.common.Representation;
|
37 |
|
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
38 |
|
|
import eu.etaxonomy.cdm.model.media.Media;
|
39 |
3dd6c00e
|
Andreas Müller
|
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
|
40 |
17f0cc4b
|
h.fradin
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
41 |
|
|
|
42 |
9479da48
|
Andreas Müller
|
/**
|
43 |
3a9870fa
|
m.geoffroy
|
* The class representing single-access fixed dichotomous or polytomous authored
|
44 |
|
|
* decision keys (as opposed to {@link FeatureTree multiple-access keys}) used to identify
|
45 |
|
|
* {@link SpecimenOrObservationBase specimens or observations} (this means to assign {@link Taxon taxa} to).
|
46 |
|
|
* The determination process is based on the tree structure of the key and on
|
47 |
|
|
* the statements of its leads.
|
48 |
3dd6c00e
|
Andreas Müller
|
*
|
49 |
|
|
* @author m.doering
|
50 |
9479da48
|
Andreas Müller
|
* @version 1.0
|
51 |
|
|
* @created 08-Nov-2007 13:06:28
|
52 |
|
|
*/
|
53 |
b484eedb
|
Andreas Müller
|
|
54 |
01b7ddbf
|
a.babadshanjan
|
@XmlAccessorType(XmlAccessType.FIELD)
|
55 |
17f0cc4b
|
h.fradin
|
@XmlType(name = "MediaKey", propOrder = {
|
56 |
a2a36ad5
|
ben.clark
|
"coveredTaxa",
|
57 |
|
|
"taxonomicScope",
|
58 |
17f0cc4b
|
h.fradin
|
"geographicalScope",
|
59 |
|
|
"scopeRestrictions",
|
60 |
|
|
"keyRepresentations"
|
61 |
01b7ddbf
|
a.babadshanjan
|
})
|
62 |
17f0cc4b
|
h.fradin
|
@XmlRootElement(name = "MediaKey")
|
63 |
9479da48
|
Andreas Müller
|
@Entity
|
64 |
c70a7f0f
|
Andreas Kohlbecker
|
//@Indexed disabled to reduce clutter in indexes, since this type is not used by any search
|
65 |
|
|
//@Indexed(index = "eu.etaxonomy.cdm.model.media.Media")
|
66 |
ee91bcd9
|
ben.clark
|
@Audited
|
67 |
17f0cc4b
|
h.fradin
|
public class MediaKey extends Media implements IIdentificationKey{
|
68 |
03abbcde
|
Andreas Müller
|
private static final long serialVersionUID = -29095811051894471L;
|
69 |
17f0cc4b
|
h.fradin
|
private static final Logger logger = Logger.getLogger(MediaKey.class);
|
70 |
3dd6c00e
|
Andreas Müller
|
|
71 |
01b7ddbf
|
a.babadshanjan
|
@XmlElementWrapper(name = "CoveredTaxa")
|
72 |
|
|
@XmlElement(name = "CoveredTaxon")
|
73 |
|
|
@XmlIDREF
|
74 |
|
|
@XmlSchemaType(name = "IDREF")
|
75 |
4208745a
|
ben.clark
|
@ManyToMany(fetch = FetchType.LAZY)
|
76 |
ef1b5da2
|
Andreas Müller
|
@JoinTable(name="MediaKey_CoveredTaxon")
|
77 |
3dd6c00e
|
Andreas Müller
|
@NotNull
|
78 |
03abbcde
|
Andreas Müller
|
private Set<Taxon> coveredTaxa = new HashSet<Taxon>();
|
79 |
3dd6c00e
|
Andreas Müller
|
|
80 |
17f0cc4b
|
h.fradin
|
@XmlElementWrapper( name = "GeographicalScope")
|
81 |
|
|
@XmlElement( name = "Area")
|
82 |
96c08c19
|
ben.clark
|
@XmlIDREF
|
83 |
|
|
@XmlSchemaType(name = "IDREF")
|
84 |
ee91bcd9
|
ben.clark
|
@ManyToMany(fetch = FetchType.LAZY)
|
85 |
ef1b5da2
|
Andreas Müller
|
@JoinTable(name="MediaKey_NamedArea")
|
86 |
a641fad9
|
ben.clark
|
@NotNull
|
87 |
17f0cc4b
|
h.fradin
|
private Set<NamedArea> geographicalScope = new HashSet<NamedArea>();
|
88 |
3dd6c00e
|
Andreas Müller
|
|
89 |
a2a36ad5
|
ben.clark
|
@XmlElementWrapper(name = "TaxonomicScope")
|
90 |
|
|
@XmlElement(name = "Taxon")
|
91 |
|
|
@XmlIDREF
|
92 |
|
|
@XmlSchemaType(name = "IDREF")
|
93 |
ee91bcd9
|
ben.clark
|
@ManyToMany(fetch = FetchType.LAZY)
|
94 |
ef1b5da2
|
Andreas Müller
|
@JoinTable(name="MediaKey_TaxonScope")
|
95 |
a641fad9
|
ben.clark
|
@NotNull
|
96 |
a2a36ad5
|
ben.clark
|
private Set<Taxon> taxonomicScope = new HashSet<Taxon>();
|
97 |
3dd6c00e
|
Andreas Müller
|
|
98 |
17f0cc4b
|
h.fradin
|
@XmlElementWrapper( name = "ScopeRestrictions")
|
99 |
|
|
@XmlElement( name = "Restriction")
|
100 |
|
|
@XmlIDREF
|
101 |
|
|
@XmlSchemaType(name = "IDREF")
|
102 |
|
|
@ManyToMany(fetch = FetchType.LAZY)
|
103 |
ef1b5da2
|
Andreas Müller
|
@JoinTable(name="MediaKey_Scope")
|
104 |
a641fad9
|
ben.clark
|
@NotNull
|
105 |
533cbb43
|
Andreas Müller
|
private Set<DefinedTerm> scopeRestrictions = new HashSet<DefinedTerm>();
|
106 |
3dd6c00e
|
Andreas Müller
|
|
107 |
17f0cc4b
|
h.fradin
|
@XmlElementWrapper( name = "KeyRepresentations")
|
108 |
|
|
@XmlElement( name = "KeyRepresentation")
|
109 |
|
|
@XmlIDREF
|
110 |
|
|
@XmlSchemaType(name = "IDREF")
|
111 |
96be23fc
|
Andreas Müller
|
@OneToMany(fetch=FetchType.LAZY, orphanRemoval=true)
|
112 |
|
|
@Cascade({CascadeType.SAVE_UPDATE, CascadeType.MERGE,CascadeType.DELETE})
|
113 |
a641fad9
|
ben.clark
|
@NotNull
|
114 |
17f0cc4b
|
h.fradin
|
private Set<Representation> keyRepresentations = new HashSet<Representation>();
|
115 |
3dd6c00e
|
Andreas Müller
|
|
116 |
|
|
/**
|
117 |
509b132a
|
m.geoffroy
|
* Class constructor: creates a new empty identification key instance.
|
118 |
|
|
*/
|
119 |
17f0cc4b
|
h.fradin
|
protected MediaKey() {
|
120 |
b484eedb
|
Andreas Müller
|
super();
|
121 |
|
|
}
|
122 |
3dd6c00e
|
Andreas Müller
|
|
123 |
|
|
/**
|
124 |
509b132a
|
m.geoffroy
|
* Creates a new empty identification key instance.
|
125 |
|
|
*/
|
126 |
17f0cc4b
|
h.fradin
|
public static MediaKey NewInstance(){
|
127 |
|
|
return new MediaKey();
|
128 |
509b132a
|
m.geoffroy
|
}
|
129 |
b484eedb
|
Andreas Müller
|
|
130 |
3dd6c00e
|
Andreas Müller
|
|
131 |
|
|
/**
|
132 |
509b132a
|
m.geoffroy
|
* Returns the set of possible {@link Taxon taxa} corresponding to
|
133 |
|
|
* <i>this</i> identification key.
|
134 |
|
|
*/
|
135 |
3dd6c00e
|
Andreas Müller
|
@Override
|
136 |
|
|
public Set<Taxon> getCoveredTaxa() {
|
137 |
a641fad9
|
ben.clark
|
if(coveredTaxa == null) {
|
138 |
|
|
this.coveredTaxa = new HashSet<Taxon>();
|
139 |
|
|
}
|
140 |
9479da48
|
Andreas Müller
|
return coveredTaxa;
|
141 |
|
|
}
|
142 |
509b132a
|
m.geoffroy
|
/**
|
143 |
3dd6c00e
|
Andreas Müller
|
* @see #getCoveredTaxa()
|
144 |
509b132a
|
m.geoffroy
|
*/
|
145 |
9479da48
|
Andreas Müller
|
protected void setCoveredTaxa(Set<Taxon> coveredTaxa) {
|
146 |
|
|
this.coveredTaxa = coveredTaxa;
|
147 |
|
|
}
|
148 |
3dd6c00e
|
Andreas Müller
|
|
149 |
509b132a
|
m.geoffroy
|
/**
|
150 |
|
|
* Adds a {@link Taxon taxa} to the set of {@link #getCoveredTaxa() covered taxa}
|
151 |
|
|
* corresponding to <i>this</i> identification key.
|
152 |
3dd6c00e
|
Andreas Müller
|
*
|
153 |
509b132a
|
m.geoffroy
|
* @param taxon the taxon to be added to <i>this</i> identification key
|
154 |
|
|
* @see #getCoveredTaxa()
|
155 |
|
|
*/
|
156 |
3dd6c00e
|
Andreas Müller
|
@Override
|
157 |
|
|
public void addCoveredTaxon(Taxon taxon) {
|
158 |
9479da48
|
Andreas Müller
|
this.coveredTaxa.add(taxon);
|
159 |
|
|
}
|
160 |
3dd6c00e
|
Andreas Müller
|
|
161 |
|
|
/**
|
162 |
509b132a
|
m.geoffroy
|
* Removes one element from the set of {@link #getCoveredTaxa() covered taxa}
|
163 |
|
|
* corresponding to <i>this</i> identification key.
|
164 |
|
|
*
|
165 |
|
|
* @param taxon the taxon which should be removed
|
166 |
|
|
* @see #getCoveredTaxa()
|
167 |
|
|
* @see #addCoveredTaxon(Taxon)
|
168 |
|
|
*/
|
169 |
3dd6c00e
|
Andreas Müller
|
@Override
|
170 |
|
|
public void removeCoveredTaxon(Taxon taxon) {
|
171 |
9479da48
|
Andreas Müller
|
this.coveredTaxa.remove(taxon);
|
172 |
|
|
}
|
173 |
|
|
|
174 |
3dd6c00e
|
Andreas Müller
|
/**
|
175 |
a2a36ad5
|
ben.clark
|
* Returns the set of {@link NamedArea named areas} indicating the geospatial
|
176 |
|
|
* data where <i>this</i> identification key is valid.
|
177 |
|
|
*/
|
178 |
3dd6c00e
|
Andreas Müller
|
@Override
|
179 |
|
|
public Set<NamedArea> getGeographicalScope() {
|
180 |
a641fad9
|
ben.clark
|
if(geographicalScope == null) {
|
181 |
|
|
this.geographicalScope = new HashSet<NamedArea>();
|
182 |
|
|
}
|
183 |
17f0cc4b
|
h.fradin
|
return geographicalScope;
|
184 |
a2a36ad5
|
ben.clark
|
}
|
185 |
3dd6c00e
|
Andreas Müller
|
|
186 |
a2a36ad5
|
ben.clark
|
/**
|
187 |
|
|
* Adds a {@link NamedArea geoScope} to the set of {@link #getGeoScopes() geogspatial scopes}
|
188 |
|
|
* corresponding to <i>this</i> identification key.
|
189 |
3dd6c00e
|
Andreas Müller
|
*
|
190 |
a2a36ad5
|
ben.clark
|
* @param geoScope the named area to be added to <i>this</i> identification key
|
191 |
|
|
* @see #getGeoScopes()
|
192 |
|
|
*/
|
193 |
3dd6c00e
|
Andreas Müller
|
@Override
|
194 |
|
|
public void addGeographicalScope(NamedArea geoScope) {
|
195 |
17f0cc4b
|
h.fradin
|
this.geographicalScope.add(geoScope);
|
196 |
a2a36ad5
|
ben.clark
|
}
|
197 |
3dd6c00e
|
Andreas Müller
|
/**
|
198 |
a2a36ad5
|
ben.clark
|
* Removes one element from the set of {@link #getGeoScopes() geogspatial scopes}
|
199 |
|
|
* corresponding to <i>this</i> identification key.
|
200 |
|
|
*
|
201 |
|
|
* @param geoScope the named area which should be removed
|
202 |
|
|
* @see #getGeoScopes()
|
203 |
|
|
* @see #addGeoScope(NamedArea)
|
204 |
|
|
*/
|
205 |
3dd6c00e
|
Andreas Müller
|
@Override
|
206 |
|
|
public void removeGeographicalScope(NamedArea geoScope) {
|
207 |
17f0cc4b
|
h.fradin
|
this.geographicalScope.remove(geoScope);
|
208 |
a2a36ad5
|
ben.clark
|
}
|
209 |
|
|
|
210 |
3dd6c00e
|
Andreas Müller
|
/**
|
211 |
a2a36ad5
|
ben.clark
|
* Returns the set of {@link Taxon taxa} that define the taxonomic
|
212 |
3dd6c00e
|
Andreas Müller
|
* scope of <i>this</i> identification key
|
213 |
a2a36ad5
|
ben.clark
|
*/
|
214 |
3dd6c00e
|
Andreas Müller
|
@Override
|
215 |
|
|
public Set<Taxon> getTaxonomicScope() {
|
216 |
a641fad9
|
ben.clark
|
if(taxonomicScope == null) {
|
217 |
|
|
this.taxonomicScope = new HashSet<Taxon>();
|
218 |
|
|
}
|
219 |
a2a36ad5
|
ben.clark
|
return taxonomicScope;
|
220 |
|
|
}
|
221 |
3dd6c00e
|
Andreas Müller
|
|
222 |
a2a36ad5
|
ben.clark
|
/**
|
223 |
|
|
* Adds a {@link Taxon taxa} to the set of {@link #getTaxonomicScope() taxonomic scopes}
|
224 |
|
|
* corresponding to <i>this</i> identification key.
|
225 |
3dd6c00e
|
Andreas Müller
|
*
|
226 |
a2a36ad5
|
ben.clark
|
* @param taxon the taxon to be added to <i>this</i> identification key
|
227 |
|
|
* @see #getTaxonomicScope()
|
228 |
|
|
*/
|
229 |
3dd6c00e
|
Andreas Müller
|
@Override
|
230 |
|
|
public void addTaxonomicScope(Taxon taxon) {
|
231 |
a2a36ad5
|
ben.clark
|
this.taxonomicScope.add(taxon);
|
232 |
|
|
}
|
233 |
3dd6c00e
|
Andreas Müller
|
|
234 |
|
|
/**
|
235 |
a2a36ad5
|
ben.clark
|
* Removes one element from the set of {@link #getTaxonomicScope() taxonomic scopes}
|
236 |
|
|
* corresponding to <i>this</i> identification key.
|
237 |
|
|
*
|
238 |
|
|
* @param taxon the taxon which should be removed
|
239 |
|
|
* @see #getTaxonomicScope()
|
240 |
|
|
* @see #addTaxonomicScope(Taxon)
|
241 |
|
|
*/
|
242 |
3dd6c00e
|
Andreas Müller
|
@Override
|
243 |
|
|
public void removeTaxonomicScope(Taxon taxon) {
|
244 |
a2a36ad5
|
ben.clark
|
this.taxonomicScope.remove(taxon);
|
245 |
|
|
}
|
246 |
3dd6c00e
|
Andreas Müller
|
|
247 |
|
|
/**
|
248 |
17f0cc4b
|
h.fradin
|
* Returns the set of {@link Representation key representations} corresponding to
|
249 |
3dd6c00e
|
Andreas Müller
|
* <i>this</i> identification key
|
250 |
17f0cc4b
|
h.fradin
|
*/
|
251 |
|
|
public Set<Representation> getKeyRepresentations() {
|
252 |
a641fad9
|
ben.clark
|
if(keyRepresentations == null) {
|
253 |
|
|
this.keyRepresentations = new HashSet<Representation>();
|
254 |
|
|
}
|
255 |
17f0cc4b
|
h.fradin
|
return keyRepresentations;
|
256 |
|
|
}
|
257 |
3dd6c00e
|
Andreas Müller
|
|
258 |
17f0cc4b
|
h.fradin
|
/**
|
259 |
|
|
* Adds a {@link Representation key representation} to the set of {@link #getKeyRepresentations() key representations}
|
260 |
|
|
* corresponding to <i>this</i> identification key.
|
261 |
3dd6c00e
|
Andreas Müller
|
*
|
262 |
17f0cc4b
|
h.fradin
|
* @param keyRepresentation the key representation to be added to <i>this</i> identification key
|
263 |
|
|
* @see #getKeyRepresentations()
|
264 |
|
|
*/
|
265 |
|
|
public void addKeyRepresentation(Representation keyRepresentation) {
|
266 |
|
|
this.keyRepresentations.add(keyRepresentation);
|
267 |
|
|
}
|
268 |
3dd6c00e
|
Andreas Müller
|
|
269 |
|
|
/**
|
270 |
17f0cc4b
|
h.fradin
|
* Removes one element from the set of {@link #getKeyRepresentations() key representations}
|
271 |
|
|
* corresponding to <i>this</i> identification key.
|
272 |
|
|
*
|
273 |
|
|
* @param keyRepresentation the key representation which should be removed
|
274 |
|
|
* @see #getKeyRepresentations()
|
275 |
|
|
* @see #addKeyRepresentation(Representation)
|
276 |
|
|
*/
|
277 |
|
|
public void removeKeyRepresentation(Representation keyRepresentation) {
|
278 |
|
|
this.keyRepresentations.remove(keyRepresentation);
|
279 |
|
|
}
|
280 |
3dd6c00e
|
Andreas Müller
|
|
281 |
|
|
/**
|
282 |
17f0cc4b
|
h.fradin
|
* Returns the set of {@link Scope scope restrictions} corresponding to
|
283 |
3dd6c00e
|
Andreas Müller
|
* <i>this</i> identification key
|
284 |
17f0cc4b
|
h.fradin
|
*/
|
285 |
3dd6c00e
|
Andreas Müller
|
@Override
|
286 |
|
|
public Set<DefinedTerm> getScopeRestrictions() {
|
287 |
a641fad9
|
ben.clark
|
if(scopeRestrictions == null) {
|
288 |
533cbb43
|
Andreas Müller
|
this.scopeRestrictions = new HashSet<DefinedTerm>();
|
289 |
a641fad9
|
ben.clark
|
}
|
290 |
17f0cc4b
|
h.fradin
|
return scopeRestrictions;
|
291 |
|
|
}
|
292 |
3dd6c00e
|
Andreas Müller
|
|
293 |
17f0cc4b
|
h.fradin
|
/**
|
294 |
|
|
* Adds a {@link Scope scope restriction} to the set of {@link #getScopeRestrictions() scope restrictions}
|
295 |
|
|
* corresponding to <i>this</i> identification key.
|
296 |
3dd6c00e
|
Andreas Müller
|
*
|
297 |
17f0cc4b
|
h.fradin
|
* @param scopeRestriction the scope restriction to be added to <i>this</i> identification key
|
298 |
|
|
* @see #getScopeRestrictions()
|
299 |
|
|
*/
|
300 |
3dd6c00e
|
Andreas Müller
|
@Override
|
301 |
|
|
public void addScopeRestriction(DefinedTerm scopeRestriction) {
|
302 |
17f0cc4b
|
h.fradin
|
this.scopeRestrictions.add(scopeRestriction);
|
303 |
|
|
}
|
304 |
3dd6c00e
|
Andreas Müller
|
|
305 |
|
|
/**
|
306 |
17f0cc4b
|
h.fradin
|
* Removes one element from the set of {@link #getScopeRestrictions() scope restrictions}
|
307 |
|
|
* corresponding to <i>this</i> identification key.
|
308 |
|
|
*
|
309 |
|
|
* @param scopeRestriction the scope restriction which should be removed
|
310 |
|
|
* @see #getScopeRestrictions()
|
311 |
|
|
* @see #addScopeRestriction(Scope)
|
312 |
|
|
*/
|
313 |
3dd6c00e
|
Andreas Müller
|
@Override
|
314 |
|
|
public void removeScopeRestriction(DefinedTerm scopeRestriction) {
|
315 |
17f0cc4b
|
h.fradin
|
this.scopeRestrictions.remove(scopeRestriction);
|
316 |
|
|
}
|
317 |
3dd6c00e
|
Andreas Müller
|
|
318 |
1f105b30
|
Katja Luther
|
//*********************** CLONE ********************************************************/
|
319 |
3dd6c00e
|
Andreas Müller
|
|
320 |
|
|
/**
|
321 |
1f105b30
|
Katja Luther
|
* Clones <i>this</i> MediaKey. This is a shortcut that enables to create
|
322 |
|
|
* a new instance that differs only slightly from <i>this</i> MediaKey by
|
323 |
|
|
* modifying only some of the attributes.
|
324 |
3dd6c00e
|
Andreas Müller
|
*
|
325 |
1f105b30
|
Katja Luther
|
* @see eu.etaxonomy.cdm.model.media.Media#clone()
|
326 |
|
|
* @see java.lang.Object#clone()
|
327 |
|
|
*/
|
328 |
|
|
@Override
|
329 |
|
|
public Object clone() {
|
330 |
|
|
MediaKey result;
|
331 |
3dd6c00e
|
Andreas Müller
|
|
332 |
1f105b30
|
Katja Luther
|
try{
|
333 |
|
|
result = (MediaKey)super.clone();
|
334 |
3dd6c00e
|
Andreas Müller
|
|
335 |
1f105b30
|
Katja Luther
|
result.coveredTaxa = new HashSet<Taxon>();
|
336 |
|
|
for (Taxon taxon: this.coveredTaxa){
|
337 |
|
|
result.addCoveredTaxon(taxon);
|
338 |
|
|
}
|
339 |
3dd6c00e
|
Andreas Müller
|
|
340 |
1f105b30
|
Katja Luther
|
result.geographicalScope = new HashSet<NamedArea>();
|
341 |
|
|
for (NamedArea area: this.geographicalScope){
|
342 |
|
|
result.addGeographicalScope(area);
|
343 |
|
|
}
|
344 |
3dd6c00e
|
Andreas Müller
|
|
345 |
1f105b30
|
Katja Luther
|
result.keyRepresentations = new HashSet<Representation>();
|
346 |
|
|
for (Representation rep: this.keyRepresentations) {
|
347 |
|
|
result.addKeyRepresentation(rep);
|
348 |
|
|
}
|
349 |
3dd6c00e
|
Andreas Müller
|
|
350 |
533cbb43
|
Andreas Müller
|
result.scopeRestrictions = new HashSet<DefinedTerm>();
|
351 |
|
|
for (DefinedTerm scope: this.scopeRestrictions){
|
352 |
1f105b30
|
Katja Luther
|
result.addScopeRestriction(scope);
|
353 |
|
|
}
|
354 |
3dd6c00e
|
Andreas Müller
|
|
355 |
1f105b30
|
Katja Luther
|
result.taxonomicScope = new HashSet<Taxon>();
|
356 |
|
|
for (Taxon taxon: this.taxonomicScope){
|
357 |
|
|
result.addTaxonomicScope(taxon);
|
358 |
|
|
}
|
359 |
3dd6c00e
|
Andreas Müller
|
|
360 |
1f105b30
|
Katja Luther
|
return result;
|
361 |
3dd6c00e
|
Andreas Müller
|
|
362 |
1f105b30
|
Katja Luther
|
}catch (CloneNotSupportedException e) {
|
363 |
|
|
logger.warn("Object does not implement cloneable");
|
364 |
|
|
e.printStackTrace();
|
365 |
|
|
return null;
|
366 |
|
|
}
|
367 |
3dd6c00e
|
Andreas Müller
|
|
368 |
|
|
|
369 |
1f105b30
|
Katja Luther
|
}
|
370 |
9479da48
|
Andreas Müller
|
}
|