1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* 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.name;
|
11
|
|
12
|
|
13
|
import java.util.HashSet;
|
14
|
import java.util.Set;
|
15
|
|
16
|
import javax.persistence.Entity;
|
17
|
import javax.persistence.FetchType;
|
18
|
import javax.persistence.OneToMany;
|
19
|
import javax.persistence.Transient;
|
20
|
import javax.xml.bind.annotation.XmlAccessType;
|
21
|
import javax.xml.bind.annotation.XmlAccessorType;
|
22
|
import javax.xml.bind.annotation.XmlElement;
|
23
|
import javax.xml.bind.annotation.XmlElementWrapper;
|
24
|
import javax.xml.bind.annotation.XmlRootElement;
|
25
|
import javax.xml.bind.annotation.XmlType;
|
26
|
|
27
|
import org.apache.log4j.Logger;
|
28
|
import org.hibernate.annotations.Cascade;
|
29
|
import org.hibernate.annotations.CascadeType;
|
30
|
import org.hibernate.envers.Audited;
|
31
|
import org.hibernate.search.annotations.Indexed;
|
32
|
import org.springframework.beans.factory.annotation.Configurable;
|
33
|
|
34
|
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
|
35
|
import eu.etaxonomy.cdm.model.common.RelationshipBase;
|
36
|
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
|
37
|
import eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy;
|
38
|
import eu.etaxonomy.cdm.strategy.parser.INonViralNameParser;
|
39
|
import eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl;
|
40
|
|
41
|
/**
|
42
|
* The taxon name class for plants and fungi.
|
43
|
* <P>
|
44
|
* This class corresponds to: NameBotanical according to the ABCD schema.
|
45
|
*
|
46
|
* @author m.doering
|
47
|
* @version 1.0
|
48
|
* @created 08-Nov-2007 13:06:15
|
49
|
*/
|
50
|
@XmlAccessorType(XmlAccessType.FIELD)
|
51
|
@XmlType(name = "BotanicalName", propOrder = {
|
52
|
"hybridFormula",
|
53
|
"monomHybrid",
|
54
|
"binomHybrid",
|
55
|
"trinomHybrid",
|
56
|
"anamorphic",
|
57
|
"hybridRelationships"
|
58
|
})
|
59
|
@XmlRootElement(name = "BotanicalName")
|
60
|
@Entity
|
61
|
@Indexed(index = "eu.etaxonomy.cdm.model.name.TaxonNameBase")
|
62
|
@Audited
|
63
|
@Configurable
|
64
|
public class BotanicalName extends NonViralName<BotanicalName> {
|
65
|
|
66
|
/**
|
67
|
*
|
68
|
*/
|
69
|
private static final long serialVersionUID = 6818651572463497727L;
|
70
|
|
71
|
private static final Logger logger = Logger.getLogger(BotanicalName.class);
|
72
|
|
73
|
//if set: this name is a hybrid formula (a hybrid that does not have an own name) and no other hybrid flags may be set. A
|
74
|
//hybrid name may not have either an authorteam nor other name components.
|
75
|
@XmlElement(name ="IsHybridFormula")
|
76
|
private boolean hybridFormula = false;
|
77
|
|
78
|
@XmlElement(name ="IsMonomHybrid")
|
79
|
private boolean monomHybrid = false;
|
80
|
|
81
|
@XmlElement(name ="IsBinomHybrid")
|
82
|
private boolean binomHybrid = false;
|
83
|
|
84
|
@XmlElement(name ="IsTrinomHybrid")
|
85
|
private boolean trinomHybrid = false;
|
86
|
|
87
|
//Only for fungi: to indicate that the type of the name is asexual or not
|
88
|
@XmlElement(name ="IsAnamorphic")
|
89
|
private boolean anamorphic;
|
90
|
|
91
|
@XmlElementWrapper(name = "HybridRelationships")
|
92
|
@XmlElement(name = "HybridRelationship")
|
93
|
@OneToMany(fetch = FetchType.LAZY)
|
94
|
@Cascade({CascadeType.SAVE_UPDATE, CascadeType.DELETE_ORPHAN})
|
95
|
private Set<HybridRelationship> hybridRelationships = new HashSet();
|
96
|
|
97
|
static private INonViralNameParser nameParser = new NonViralNameParserImpl();
|
98
|
|
99
|
// ************* CONSTRUCTORS *************/
|
100
|
//needed by hibernate
|
101
|
/**
|
102
|
* Class constructor: creates a new botanical taxon name instance
|
103
|
* only containing the {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}.
|
104
|
*
|
105
|
* @see #BotanicalName(Rank, HomotypicalGroup)
|
106
|
* @see #BotanicalName(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
|
107
|
* @see eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
|
108
|
*/
|
109
|
protected BotanicalName(){
|
110
|
super();
|
111
|
this.cacheStrategy = BotanicNameDefaultCacheStrategy.NewInstance();
|
112
|
}
|
113
|
/**
|
114
|
* Class constructor: creates a new botanical taxon name instance
|
115
|
* only containing its {@link Rank rank},
|
116
|
* its {@link HomotypicalGroup homotypical group} and
|
117
|
* the {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}.
|
118
|
* The new botanical taxon name instance will be also added to the set of
|
119
|
* botanical taxon names belonging to this homotypical group.
|
120
|
*
|
121
|
* @param rank the rank to be assigned to <i>this</i> botanical taxon name
|
122
|
* @param homotypicalGroup the homotypical group to which <i>this</i> botanical taxon name belongs
|
123
|
* @see #BotanicalName()
|
124
|
* @see #BotanicalName(Rank, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
|
125
|
* @see eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
|
126
|
*/
|
127
|
protected BotanicalName(Rank rank, HomotypicalGroup homotypicalGroup) {
|
128
|
super(rank, homotypicalGroup);
|
129
|
this.cacheStrategy = BotanicNameDefaultCacheStrategy.NewInstance();
|
130
|
}
|
131
|
/**
|
132
|
* Class constructor: creates a new botanical taxon name instance
|
133
|
* containing its {@link Rank rank},
|
134
|
* its {@link HomotypicalGroup homotypical group},
|
135
|
* its scientific name components, its {@link eu.etaxonomy.cdm.model.agent.TeamOrPersonBase author(team)},
|
136
|
* its {@link eu.etaxonomy.cdm.model.reference.INomenclaturalReference nomenclatural reference} and
|
137
|
* the {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}.
|
138
|
* The new botanical taxon name instance will be also added to the set of
|
139
|
* botanical taxon names belonging to this homotypical group.
|
140
|
*
|
141
|
* @param rank the rank to be assigned to <i>this</i> botanical taxon name
|
142
|
* @param genusOrUninomial the string for <i>this</i> botanical taxon name
|
143
|
* if its rank is genus or higher or for the genus part
|
144
|
* if its rank is lower than genus
|
145
|
* @param infraGenericEpithet the string for the first epithet of
|
146
|
* <i>this</i> botanical taxon name if its rank is lower than genus
|
147
|
* and higher than species aggregate
|
148
|
* @param specificEpithet the string for the first epithet of
|
149
|
* <i>this</i> botanical taxon name if its rank is species aggregate or lower
|
150
|
* @param infraSpecificEpithet the string for the second epithet of
|
151
|
* <i>this</i> botanical taxon name if its rank is lower than species
|
152
|
* @param combinationAuthorTeam the author or the team who published <i>this</i> botanical taxon name
|
153
|
* @param nomenclaturalReference the nomenclatural reference where <i>this</i> botanical taxon name was published
|
154
|
* @param nomenclMicroRef the string with the details for precise location within the nomenclatural reference
|
155
|
* @param homotypicalGroup the homotypical group to which <i>this</i> botanical taxon name belongs
|
156
|
* @see #BotanicalName()
|
157
|
* @see #BotanicalName(Rank, HomotypicalGroup)
|
158
|
* @see #NewInstance(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
|
159
|
* @see eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
|
160
|
* @see eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy
|
161
|
* @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy
|
162
|
*/
|
163
|
protected BotanicalName(Rank rank, String genusOrUninomial, String infraGenericEpithet, String specificEpithet, String infraSpecificEpithet, TeamOrPersonBase combinationAuthorTeam, INomenclaturalReference nomenclaturalReference, String nomenclMicroRef, HomotypicalGroup homotypicalGroup) {
|
164
|
super(rank, genusOrUninomial, infraGenericEpithet, specificEpithet, infraSpecificEpithet, combinationAuthorTeam, nomenclaturalReference, nomenclMicroRef, homotypicalGroup);
|
165
|
this.cacheStrategy = BotanicNameDefaultCacheStrategy.NewInstance();
|
166
|
}
|
167
|
|
168
|
|
169
|
//********* METHODS **************************************/
|
170
|
|
171
|
/**
|
172
|
* Creates a new botanical taxon name instance
|
173
|
* only containing its {@link Rank rank} and
|
174
|
* the {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}.
|
175
|
*
|
176
|
* @param rank the rank to be assigned to <i>this</i> botanical taxon name
|
177
|
* @see #BotanicalName(Rank, HomotypicalGroup)
|
178
|
* @see #NewInstance(Rank, HomotypicalGroup)
|
179
|
* @see #NewInstance(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
|
180
|
* @see eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
|
181
|
*/
|
182
|
public static BotanicalName NewInstance(Rank rank){
|
183
|
return new BotanicalName(rank, null);
|
184
|
}
|
185
|
/**
|
186
|
* Creates a new botanical taxon name instance
|
187
|
* only containing its {@link Rank rank},
|
188
|
* its {@link HomotypicalGroup homotypical group} and
|
189
|
* the {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}.
|
190
|
* The new botanical taxon name instance will be also added to the set of
|
191
|
* botanical taxon names belonging to this homotypical group.
|
192
|
*
|
193
|
* @param rank the rank to be assigned to <i>this</i> botanical taxon name
|
194
|
* @param homotypicalGroup the homotypical group to which <i>this</i> botanical taxon name belongs
|
195
|
* @see #NewInstance(Rank)
|
196
|
* @see #NewInstance(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
|
197
|
* @see #BotanicalName(Rank, HomotypicalGroup)
|
198
|
* @see eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
|
199
|
*/
|
200
|
public static BotanicalName NewInstance(Rank rank, HomotypicalGroup homotypicalGroup){
|
201
|
return new BotanicalName(rank, homotypicalGroup);
|
202
|
}
|
203
|
/**
|
204
|
* Creates a new botanical taxon name instance
|
205
|
* containing its {@link Rank rank},
|
206
|
* its {@link HomotypicalGroup homotypical group},
|
207
|
* its scientific name components, its {@link eu.etaxonomy.cdm.model.agent.TeamOrPersonBase author(team)},
|
208
|
* its {@link eu.etaxonomy.cdm.model.reference.INomenclaturalReference nomenclatural reference} and
|
209
|
* the {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}.
|
210
|
* The new botanical taxon name instance will be also added to the set of
|
211
|
* botanical taxon names belonging to this homotypical group.
|
212
|
*
|
213
|
* @param rank the rank to be assigned to <i>this</i> botanical taxon name
|
214
|
* @param genusOrUninomial the string for <i>this</i> botanical taxon name
|
215
|
* if its rank is genus or higher or for the genus part
|
216
|
* if its rank is lower than genus
|
217
|
* @param infraGenericEpithet the string for the first epithet of
|
218
|
* <i>this</i> botanical taxon name if its rank is lower than genus
|
219
|
* and higher than species aggregate
|
220
|
* @param specificEpithet the string for the first epithet of
|
221
|
* <i>this</i> botanical taxon name if its rank is species aggregate or lower
|
222
|
* @param infraSpecificEpithet the string for the second epithet of
|
223
|
* <i>this</i> botanical taxon name if its rank is lower than species
|
224
|
* @param combinationAuthorTeam the author or the team who published <i>this</i> botanical taxon name
|
225
|
* @param nomenclaturalReference the nomenclatural reference where <i>this</i> botanical taxon name was published
|
226
|
* @param nomenclMicroRef the string with the details for precise location within the nomenclatural reference
|
227
|
* @param homotypicalGroup the homotypical group to which <i>this</i> botanical taxon name belongs
|
228
|
* @see #NewInstance(Rank)
|
229
|
* @see #NewInstance(Rank, HomotypicalGroup)
|
230
|
* @see ZoologicalName#ZoologicalName(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
|
231
|
* @see eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
|
232
|
*/
|
233
|
public static BotanicalName NewInstance(Rank rank, String genusOrUninomial, String infraGenericEpithet, String specificEpithet, String infraSpecificEpithet, TeamOrPersonBase combinationAuthorTeam, INomenclaturalReference nomenclaturalReference, String nomenclMicroRef, HomotypicalGroup homotypicalGroup) {
|
234
|
return new BotanicalName(rank, genusOrUninomial, infraGenericEpithet, specificEpithet, infraSpecificEpithet, combinationAuthorTeam, nomenclaturalReference, nomenclMicroRef, homotypicalGroup);
|
235
|
}
|
236
|
|
237
|
/**
|
238
|
* Returns a botanical taxon name based on parsing a string representing
|
239
|
* all elements (according to the ICBN) of a botanical taxon name (where
|
240
|
* the scientific name is an uninomial) including authorship but without
|
241
|
* nomenclatural reference. If the {@link Rank rank} is not "Genus" it should be
|
242
|
* set afterwards with the {@link TaxonNameBase#setRank(Rank) setRank} methode.
|
243
|
*
|
244
|
* @param fullNameString the string to be parsed
|
245
|
* @return the new botanical taxon name
|
246
|
*/
|
247
|
public static BotanicalName PARSED_NAME(String fullNameString){
|
248
|
return PARSED_NAME(fullNameString, Rank.GENUS());
|
249
|
}
|
250
|
|
251
|
/**
|
252
|
* Returns a botanical taxon name based on parsing a string representing
|
253
|
* all elements (according to the ICBN) of a botanical taxon name including
|
254
|
* authorship but without nomenclatural reference. The parsing result
|
255
|
* depends on the given rank of the botanical taxon name to be created.
|
256
|
*
|
257
|
* @param fullNameString the string to be parsed
|
258
|
* @param rank the rank of the taxon name
|
259
|
* @return the new botanical taxon name
|
260
|
*/
|
261
|
public static BotanicalName PARSED_NAME(String fullNameString, Rank rank){
|
262
|
if (nameParser == null){
|
263
|
nameParser = new NonViralNameParserImpl();
|
264
|
}
|
265
|
return (BotanicalName)nameParser.parseFullName(fullNameString, NomenclaturalCode.ICBN, rank);
|
266
|
}
|
267
|
|
268
|
/**
|
269
|
* Returns a botanical taxon name based on parsing a string representing
|
270
|
* all elements (according to the ICBN) of a botanical taxon name (where
|
271
|
* the scientific name is an uninomial) including authorship and
|
272
|
* nomenclatural reference. Eventually a new {@link eu.etaxonomy.cdm.model.reference.INomenclaturalReference nomenclatural reference}
|
273
|
* instance will also be created. If the {@link Rank rank} is not "Genus" it should be
|
274
|
* set afterwards with the {@link TaxonNameBase#setRank(Rank) setRank} methode.
|
275
|
*
|
276
|
* @param fullNameAndReferenceString the string to be parsed
|
277
|
* @return the new botanical taxon name
|
278
|
*/
|
279
|
public static BotanicalName PARSED_REFERENCE(String fullNameAndReferenceString){
|
280
|
return PARSED_REFERENCE(fullNameAndReferenceString, Rank.GENUS());
|
281
|
}
|
282
|
|
283
|
/**
|
284
|
* Returns a botanical taxon name based on parsing a string representing
|
285
|
* all elements (according to the ICBN) of a botanical taxon name including
|
286
|
* authorship and nomenclatural reference. The parsing result depends on
|
287
|
* the given rank of the botanical taxon name to be created.
|
288
|
* Eventually a new {@link eu.etaxonomy.cdm.model.reference.INomenclaturalReference nomenclatural reference}
|
289
|
* instance will also be created.
|
290
|
*
|
291
|
* @param fullNameAndReferenceString the string to be parsed
|
292
|
* @param rank the rank of the taxon name
|
293
|
* @return the new botanical taxon name
|
294
|
*/
|
295
|
public static BotanicalName PARSED_REFERENCE(String fullNameAndReferenceString, Rank rank){
|
296
|
if (nameParser == null){
|
297
|
nameParser = new NonViralNameParserImpl();
|
298
|
}
|
299
|
return (BotanicalName)nameParser.parseReferencedName(fullNameAndReferenceString, NomenclaturalCode.ICBN, rank);
|
300
|
}
|
301
|
|
302
|
|
303
|
/**
|
304
|
* Returns the set of all {@link HybridRelationship hybrid relationships}
|
305
|
* in which <i>this</i> botanical taxon name is involved. Any botanical taxon name
|
306
|
* (even itself a hybrid taxon name) can be a parent of another hybrid
|
307
|
* taxon name.
|
308
|
*
|
309
|
* @see #getParentRelationships()
|
310
|
* @see #getChildRelationships()
|
311
|
* @see #addHybridRelationship(HybridRelationship)
|
312
|
* @see #addRelationship(RelationshipBase)
|
313
|
*/
|
314
|
public Set<HybridRelationship> getHybridRelationships() {
|
315
|
return hybridRelationships;
|
316
|
}
|
317
|
|
318
|
/**
|
319
|
* Adds the given {@link HybridRelationship hybrid relationship} to the set
|
320
|
* of {@link #getHybridRelationships() hybrid relationships} of both botanical taxon names
|
321
|
* involved in this hybrid relationship. One of both botanical taxon names
|
322
|
* must be <i>this</i> botanical taxon name otherwise no addition will be carried
|
323
|
* out. The {@link eu.etaxonomy.cdm.model.common.RelationshipBase#getRelatedTo() child botanical taxon name}
|
324
|
* must be a hybrid, which means that one of its four hybrid flags must be set.
|
325
|
*
|
326
|
* @param relationship the hybrid relationship to be added
|
327
|
* @see #isHybridFormula()
|
328
|
* @see #isMonomHybrid()
|
329
|
* @see #isBinomHybrid()
|
330
|
* @see #isTrinomHybrid()
|
331
|
* @see #getHybridRelationships()
|
332
|
* @see #getParentRelationships()
|
333
|
* @see #getChildRelationships()
|
334
|
* @see #addRelationship(RelationshipBase)
|
335
|
*/
|
336
|
protected void addHybridRelationship(HybridRelationship relationship) {
|
337
|
this.hybridRelationships.add(relationship);
|
338
|
}
|
339
|
|
340
|
/**
|
341
|
* Creates a new {@link HybridRelationship#HybridRelationship(BotanicalName, BotanicalName, HybridRelationshipType, String) hybrid relationship}
|
342
|
* to <i>this</i> botanical name. A HybridRelationship may be of type
|
343
|
* "is first/second parent" or "is male/female parent". By invoking this
|
344
|
* method <i>this</i> botanical name becomes a hybrid child of the parent
|
345
|
* botanical name.
|
346
|
*
|
347
|
* @param parentName the botanical name of the parent for this new hybrid name relationship
|
348
|
* @param type the type of this new name relationship
|
349
|
* @param ruleConsidered the string which specifies the rule on which this name relationship is based
|
350
|
* @see #addHybridChild(BotanicalName, HybridRelationshipType,String )
|
351
|
* @see #getRelationsToThisName()
|
352
|
* @see #getNameRelations()
|
353
|
* @see #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
|
354
|
* @see #addNameRelationship(NameRelationship)
|
355
|
*/
|
356
|
public void addHybridParent(BotanicalName parentName, HybridRelationshipType type, String ruleConsidered){
|
357
|
HybridRelationship rel = new HybridRelationship(this, parentName, type, ruleConsidered);
|
358
|
}
|
359
|
|
360
|
/**
|
361
|
* Creates a new {@link HybridRelationship#HybridRelationship(BotanicalName, BotanicalName, HybridRelationshipType, String) hybrid relationship}
|
362
|
* to <i>this</i> botanical name. A HybridRelationship may be of type
|
363
|
* "is first/second parent" or "is male/female parent". By invoking this
|
364
|
* method <i>this</i> botanical name becomes a parent of the hybrid child
|
365
|
* botanical name.
|
366
|
*
|
367
|
* @param childName the botanical name of the child for this new hybrid name relationship
|
368
|
* @param type the type of this new name relationship
|
369
|
* @param ruleConsidered the string which specifies the rule on which this name relationship is based
|
370
|
* @see #addHybridParent(BotanicalName, HybridRelationshipType,String )
|
371
|
* @see #getRelationsToThisName()
|
372
|
* @see #getNameRelations()
|
373
|
* @see #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
|
374
|
* @see #addNameRelationship(NameRelationship)
|
375
|
*/
|
376
|
public void addHybridChild(BotanicalName childName, HybridRelationshipType type, String ruleConsidered){
|
377
|
HybridRelationship rel = new HybridRelationship(childName, this, type, ruleConsidered);
|
378
|
}
|
379
|
|
380
|
|
381
|
/**
|
382
|
* Removes one {@link HybridRelationship hybrid relationship} from the set of
|
383
|
* {@link #getHybridRelationships() hybrid relationships} in which <i>this</i> botanical taxon name
|
384
|
* is involved. The hybrid relationship will also be removed from the set
|
385
|
* belonging to the second botanical taxon name involved.
|
386
|
*
|
387
|
* @param relationship the hybrid relationship which should be deleted from the corresponding sets
|
388
|
* @see #getHybridRelationships()
|
389
|
*/
|
390
|
public void removeHybridRelationship(HybridRelationship relationship) {
|
391
|
//TODO
|
392
|
logger.warn("Birelationship not yet implemented");
|
393
|
this.hybridRelationships.remove(relationship);
|
394
|
}
|
395
|
|
396
|
/**
|
397
|
* Returns the set of all {@link HybridRelationship hybrid relationships}
|
398
|
* in which <i>this</i> botanical taxon name is involved as a {@link common.RelationshipBase#getRelatedFrom() parent}.
|
399
|
*
|
400
|
* @see #getHybridRelationships()
|
401
|
* @see #getChildRelationships()
|
402
|
* @see HybridRelationshipType
|
403
|
*/
|
404
|
public Set<HybridRelationship> getParentRelationships() {
|
405
|
// FIXME: filter relations
|
406
|
return hybridRelationships;
|
407
|
}
|
408
|
/**
|
409
|
* Returns the set of all {@link HybridRelationship hybrid relationships}
|
410
|
* in which <i>this</i> botanical taxon name is involved as a {@link common.RelationshipBase#getRelatedTo() child}.
|
411
|
*
|
412
|
* @see #getHybridRelationships()
|
413
|
* @see #getParentRelationships()
|
414
|
* @see HybridRelationshipType
|
415
|
*/
|
416
|
public Set<HybridRelationship> getChildRelationships() {
|
417
|
// FIXME: filter relations
|
418
|
return hybridRelationships;
|
419
|
}
|
420
|
|
421
|
/**
|
422
|
* Does the same as the addHybridRelationship method if the given
|
423
|
* {@link common.RelationshipBase relation} is also a {@link HybridRelationship hybrid relationship}.
|
424
|
* Otherwise this method does the same as the overwritten {@link TaxonNameBase#addRelationship(RelationshipBase) addRelationship}
|
425
|
* method from TaxonNameBase.
|
426
|
*
|
427
|
* @param relation the relationship to be added to some of <i>this</i> taxon name's relationships sets
|
428
|
* @see #addHybridRelationship(HybridRelationship)
|
429
|
* @see TaxonNameBase#addRelationship(RelationshipBase)
|
430
|
* @see TaxonNameBase#addNameRelationship(NameRelationship)
|
431
|
*/
|
432
|
@Override
|
433
|
@Deprecated //To be used by RelationshipBase only
|
434
|
public void addRelationship(RelationshipBase relation) {
|
435
|
if (relation instanceof HybridRelationship){
|
436
|
addHybridRelationship((HybridRelationship)relation);
|
437
|
}else {
|
438
|
super.addRelationship(relation);
|
439
|
}
|
440
|
}
|
441
|
|
442
|
/**
|
443
|
* Returns the boolean value of the flag indicating whether the name of <i>this</i>
|
444
|
* botanical taxon name is a hybrid formula (true) or not (false). A hybrid
|
445
|
* named by a hybrid formula (composed with its parent names by placing the
|
446
|
* multiplication sign between them) does not have an own published name
|
447
|
* and therefore has neither an {@link NonViralName#getAuthorshipCache() autorship}
|
448
|
* nor other name components. If this flag is set no other hybrid flags may
|
449
|
* be set.
|
450
|
*
|
451
|
* @return the boolean value of the isHybridFormula flag
|
452
|
* @see #isMonomHybrid()
|
453
|
* @see #isBinomHybrid()
|
454
|
* @see #isTrinomHybrid()
|
455
|
*/
|
456
|
public boolean isHybridFormula(){
|
457
|
return this.hybridFormula;
|
458
|
}
|
459
|
|
460
|
/**
|
461
|
* @see #isHybridFormula()
|
462
|
*/
|
463
|
public void setHybridFormula(boolean hybridFormula){
|
464
|
this.hybridFormula = hybridFormula;
|
465
|
}
|
466
|
|
467
|
/**
|
468
|
* Returns the boolean value of the flag indicating whether <i>this</i> botanical
|
469
|
* taxon name is the name of an intergeneric hybrid (true) or not (false).
|
470
|
* In this case the multiplication sign is placed before the scientific
|
471
|
* name. If this flag is set no other hybrid flags may be set.
|
472
|
*
|
473
|
* @return the boolean value of the isMonomHybrid flag
|
474
|
* @see #isHybridFormula()
|
475
|
* @see #isBinomHybrid()
|
476
|
* @see #isTrinomHybrid()
|
477
|
*/
|
478
|
public boolean isMonomHybrid(){
|
479
|
return this.monomHybrid;
|
480
|
}
|
481
|
|
482
|
/**
|
483
|
* @see #isMonomHybrid()
|
484
|
* @see #isBinomHybrid()
|
485
|
* @see #isTrinomHybrid()
|
486
|
*/
|
487
|
public void setMonomHybrid(boolean monomHybrid){
|
488
|
this.monomHybrid = monomHybrid;
|
489
|
}
|
490
|
|
491
|
/**
|
492
|
* Returns the boolean value of the flag indicating whether <i>this</i> botanical
|
493
|
* taxon name is the name of an interspecific hybrid (true) or not (false).
|
494
|
* In this case the multiplication sign is placed before the species
|
495
|
* epithet. If this flag is set no other hybrid flags may be set.
|
496
|
*
|
497
|
* @return the boolean value of the isBinomHybrid flag
|
498
|
* @see #isHybridFormula()
|
499
|
* @see #isMonomHybrid()
|
500
|
* @see #isTrinomHybrid()
|
501
|
*/
|
502
|
public boolean isBinomHybrid(){
|
503
|
return this.binomHybrid;
|
504
|
}
|
505
|
|
506
|
/**
|
507
|
* @see #isBinomHybrid()
|
508
|
* @see #isMonomHybrid()
|
509
|
* @see #isTrinomHybrid()
|
510
|
*/
|
511
|
public void setBinomHybrid(boolean binomHybrid){
|
512
|
this.binomHybrid = binomHybrid;
|
513
|
}
|
514
|
|
515
|
/**
|
516
|
* Returns the boolean value of the flag indicating whether <i>this</i> botanical
|
517
|
* taxon name is the name of an infraspecific hybrid (true) or not (false).
|
518
|
* In this case the term "notho-" (optionally abbreviated "n-") is used as
|
519
|
* a prefix to the term denoting the infraspecific rank of <i>this</i> botanical
|
520
|
* taxon name. If this flag is set no other hybrid flags may be set.
|
521
|
*
|
522
|
* @return the boolean value of the isTrinomHybrid flag
|
523
|
* @see #isHybridFormula()
|
524
|
* @see #isMonomHybrid()
|
525
|
* @see #isBinomHybrid()
|
526
|
*/
|
527
|
public boolean isTrinomHybrid(){
|
528
|
return this.trinomHybrid;
|
529
|
}
|
530
|
|
531
|
/**
|
532
|
* @see #isTrinomHybrid()
|
533
|
* @see #isBinomHybrid()
|
534
|
* @see #isMonomHybrid()
|
535
|
*/
|
536
|
public void setTrinomHybrid(boolean trinomHybrid){
|
537
|
this.trinomHybrid = trinomHybrid;
|
538
|
}
|
539
|
|
540
|
/**
|
541
|
* Returns the boolean value of the flag indicating whether the specimen
|
542
|
* type of <i>this</i> botanical taxon name for a fungus is asexual (true) or not
|
543
|
* (false). This applies only in case of fungi. The Article 59 of the ICBN
|
544
|
* permits mycologists to give asexually reproducing fungi (anamorphs)
|
545
|
* separate names from their sexual states (teleomorphs).
|
546
|
*
|
547
|
* @return the boolean value of the isAnamorphic flag
|
548
|
*/
|
549
|
public boolean isAnamorphic(){
|
550
|
return this.anamorphic;
|
551
|
}
|
552
|
|
553
|
/**
|
554
|
* @see #isAnamorphic()
|
555
|
*/
|
556
|
public void setAnamorphic(boolean anamorphic){
|
557
|
this.anamorphic = anamorphic;
|
558
|
}
|
559
|
|
560
|
|
561
|
/**
|
562
|
* Returns the {@link NomenclaturalCode nomenclatural code} that governs
|
563
|
* the construction of <i>this</i> botanical taxon name, that is the
|
564
|
* International Code of Botanical Nomenclature. This method overrides
|
565
|
* the getNomeclaturalCode method from {@link NonViralName NonViralName}.
|
566
|
*
|
567
|
* @return the nomenclatural code for plants
|
568
|
* @see NonViralName#isCodeCompliant()
|
569
|
* @see TaxonNameBase#getHasProblem()
|
570
|
*/
|
571
|
@Override
|
572
|
public NomenclaturalCode getNomenclaturalCode(){
|
573
|
return NomenclaturalCode.ICBN;
|
574
|
}
|
575
|
|
576
|
}
|