Project

General

Profile

Revision 1e42628a

ID1e42628a4c24232f9b03a2a1e508d7cd79e0e0ba
Parent 7d8c9613
Child 083968cb

Added by Andreas Müller about 3 years ago

ref #6369 Add interfaces for TaxonNameBase and NonViralName

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/INonViralName.java
1
/**
2
* Copyright (C) 2017 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
package eu.etaxonomy.cdm.model.name;
10

  
11
import java.util.List;
12
import java.util.Set;
13

  
14
import javax.persistence.Transient;
15

  
16
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
17

  
18
/**
19
 * @author a.mueller
20
 * @date 21.01.2017
21
 *
22
 */
23
public interface INonViralName<T extends NonViralName> extends ITaxonNameBase<T>{
24

  
25
    /**
26
     * Creates a new {@link HybridRelationship#HybridRelationship(TaxonNameBase, TaxonNameBase, HybridRelationshipType, String) hybrid relationship}
27
     * to <i>this</i> non viral name. A HybridRelationship may be of type
28
     * "is first/second parent" or "is male/female parent". By invoking this
29
     * method <i>this</i> non viral name becomes a parent of the hybrid child
30
     * non viral name.
31
     *
32
     * @param childName       the non viral name of the child for this new hybrid name relationship
33
     * @param type            the type of this new name relationship
34
     * @param ruleConsidered  the string which specifies the rule on which this name relationship is based
35
     * @return
36
     * @see                   #addHybridParent(TaxonNameBase, HybridRelationshipType,String )
37
     * @see                   #getRelationsToThisName()
38
     * @see                   #getNameRelations()
39
     * @see                   #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
40
     * @see                   #addNameRelationship(NameRelationship)
41
     */
42
    public HybridRelationship addHybridChild(NonViralName childName, HybridRelationshipType type, String ruleConsidered);
43

  
44
    /**
45
     * Creates a new {@link HybridRelationship#HybridRelationship(TaxonNameBase, TaxonNameBase, HybridRelationshipType, String) hybrid relationship}
46
     * to <i>this</i> non viral name. A HybridRelationship may be of type
47
     * "is first/second parent" or "is male/female parent". By invoking this
48
     * method <i>this</i> non viral name becomes a hybrid child of the parent
49
     * non viral name.
50
     *
51
     * @param parentName      the non viral name of the parent for this new hybrid name relationship
52
     * @param type            the type of this new name relationship
53
     * @param ruleConsidered  the string which specifies the rule on which this name relationship is based
54
     * @return
55
     * @see                   #addHybridChild(TaxonNameBase, HybridRelationshipType,String )
56
     * @see                   #getRelationsToThisName()
57
     * @see                   #getNameRelations()
58
     * @see                   #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
59
     * @see                   #addNameRelationship(NameRelationship)
60
     */
61
    public HybridRelationship addHybridParent(NonViralName parentName, HybridRelationshipType type, String ruleConsidered);
62

  
63
    /**
64
     * Shortcut. Returns the basionym authors title cache. Returns null if no basionym author exists.
65
     * @return
66
     */
67
    public String computeBasionymAuthorNomenclaturalTitle() ;
68

  
69
    /**
70
     * Shortcut. Returns the combination authors title cache. Returns null if no combination author exists.
71
     * @return
72
     */
73
    public String computeCombinationAuthorNomenclaturalTitle();
74

  
75
    /**
76
     * Shortcut. Returns the ex-basionym authors title cache. Returns null if no exbasionym author exists.
77
     * @return
78
     */
79
    public String computeExBasionymAuthorNomenclaturalTitle();
80

  
81
    /**
82
     * Shortcut. Returns the ex-combination authors title cache. Returns null if no ex-combination author exists.
83
     * @return
84
     */
85
    public String computeExCombinationAuthorNomenclaturalTitle();
86

  
87
    /**
88
     * Generates and returns a concatenated and formatted author teams string
89
     * including basionym and combination authors of <i>this</i> non viral taxon name
90
     * according to the strategy defined in
91
     * {@link eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy#getAuthorshipCache(NonViralName) INonViralNameCacheStrategy}.
92
     *
93
     * @return  the string with the concatenated and formated author teams for <i>this</i> non viral taxon name
94
     * @see     eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy#getAuthorshipCache(NonViralName)
95
     */
96
    public String generateAuthorship();
97

  
98

  
99
    /**
100
     * Returns the concatenated and formatted author teams string including
101
     * basionym and combination authors of <i>this</i> non viral taxon name.
102
     * If the protectedAuthorshipCache flag is set this method returns the
103
     * string stored in the the authorshipCache attribute, otherwise it
104
     * generates the complete authorship string, returns it and stores it in
105
     * the authorshipCache attribute.
106
     *
107
     * @return  the string with the concatenated and formated author teams for <i>this</i> non viral taxon name
108
     * @see     #generateAuthorship()
109
     */
110
    @Transient
111
    public String getAuthorshipCache();
112

  
113
    /**
114
     * Returns the {@link eu.etaxonomy.cdm.model.agent.TeamOrPersonBase author (team)} that published the original combination
115
     * on which <i>this</i> non viral taxon name is nomenclaturally based. Such an
116
     * author (team) can only exist if <i>this</i> non viral taxon name is a new
117
     * combination due to a taxonomical revision.
118
     *
119
     * @return  the nomenclatural basionym author (team) of <i>this</i> non viral taxon name
120
     * @see     #getCombinationAuthorship()
121
     * @see     eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor
122
     * @see     eu.etaxonomy.cdm.model.agent.TeamOrPersonBase#getNomenclaturalTitle()
123
     */
124
    public TeamOrPersonBase<?> getBasionymAuthorship();
125

  
126
    /**
127
     * Returns the {@link eu.etaxonomy.cdm.model.agent.TeamOrPersonBase author (team)} that published <i>this</i> non viral
128
     * taxon name.
129
     *
130
     * @return  the nomenclatural author (team) of <i>this</i> non viral taxon name
131
     * @see     eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor
132
     * @see     eu.etaxonomy.cdm.model.agent.TeamOrPersonBase#getNomenclaturalTitle()
133
     */
134
    public TeamOrPersonBase<?> getCombinationAuthorship();
135

  
136

  
137
    /**
138
     * Returns the {@link eu.etaxonomy.cdm.model.agent.TeamOrPersonBase author (team)} that contributed to
139
     * the publication of the original combination <i>this</i> non viral taxon name is
140
     * based on. This should have been generally stated by
141
     * the {@link #getBasionymAuthorship() basionym author (team)} itself.
142
     * The presence of a basionym author (team) of <i>this</i> non viral taxon name is a
143
     * condition for the existence of an ex basionym author (team)
144
     * for <i>this</i> same name.
145
     *
146
     * @return  the nomenclatural ex basionym author (team) of <i>this</i> non viral taxon name
147
     * @see     #getBasionymAuthorship()
148
     * @see     #getExCombinationAuthorship()
149
     * @see     #getCombinationAuthorship()
150
     * @see     eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor
151
     * @see     eu.etaxonomy.cdm.model.agent.TeamOrPersonBase#getNomenclaturalTitle()
152
     */
153
    public TeamOrPersonBase<?> getExBasionymAuthorship();
154

  
155
    /**
156
     * Returns the {@link eu.etaxonomy.cdm.model.agent.TeamOrPersonBase author (team)} that contributed to
157
     * the publication of <i>this</i> non viral taxon name as generally stated by
158
     * the {@link #getCombinationAuthorship() combination author (team)} itself.<BR>
159
     * An ex-author(-team) is an author(-team) to whom a taxon name was ascribed
160
     * although it is not the author(-team) of a valid publication (for instance
161
     * without the validating description or diagnosis in case of a name for a
162
     * new taxon). The name of this ascribed authorship, followed by "ex", may
163
     * be inserted before the name(s) of the publishing author(s) of the validly
164
     * published name:<BR>
165
     * <i>Lilium tianschanicum</i> was described by Grubov (1977) as a new species and
166
     * its name was ascribed to Ivanova; since there is no indication that
167
     * Ivanova provided the validating description, the name may be cited as
168
     * <i>Lilium tianschanicum</i> N. A. Ivanova ex Grubov or <i>Lilium tianschanicum</i> Grubov.
169
     * <P>
170
     * The presence of an author (team) of <i>this</i> non viral taxon name is a
171
     * condition for the existence of an ex author (team) for <i>this</i> same name.
172
     *
173
     * @return  the nomenclatural ex author (team) of <i>this</i> non viral taxon name
174
     * @see     #getCombinationAuthorship()
175
     * @see     eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor
176
     * @see     eu.etaxonomy.cdm.model.agent.TeamOrPersonBase#getNomenclaturalTitle()
177
     */
178
    public TeamOrPersonBase<?> getExCombinationAuthorship();
179

  
180
    /**
181
     * Returns either the scientific name string (without authorship) for <i>this</i>
182
     * non viral taxon name if its rank is genus or higher (monomial) or the string for
183
     * the genus part of it if its {@link Rank rank} is lower than genus (bi- or trinomial).
184
     * Genus or uninomial strings begin with an upper case letter.
185
     *
186
     * @return  the string containing the suprageneric name, the genus name or the genus part of <i>this</i> non viral taxon name
187
     * @see     #getNameCache()
188
     */
189
    public String getGenusOrUninomial();
190

  
191
    /**
192
     * Returns the set of all {@link HybridRelationship hybrid relationships}
193
     * in which <i>this</i> taxon name is involved as a {@link common.RelationshipBase#getRelatedTo() child}.
194
     *
195
     * @see    #getHybridRelationships()
196
     * @see    #getParentRelationships()
197
     * @see    HybridRelationshipType
198
     */
199
    public Set<HybridRelationship> getHybridChildRelations();
200

  
201
    /**
202
     * Returns the set of all {@link HybridRelationship hybrid relationships}
203
     * in which <i>this</i> taxon name is involved as a {@link common.RelationshipBase#getRelatedFrom() parent}.
204
     *
205
     * @see    #getHybridRelationships()
206
     * @see    #getChildRelationships()
207
     * @see    HybridRelationshipType
208
     */
209
    public Set<HybridRelationship> getHybridParentRelations();
210

  
211
    /**
212
     * Returns the genus subdivision epithet string (infrageneric part) for
213
     * <i>this</i> non viral taxon name if its {@link Rank rank} is infrageneric (lower than genus and
214
     * higher than species aggregate: binomial). Genus subdivision epithet
215
     * strings begin with an upper case letter.
216
     *
217
     * @return  the string containing the infrageneric part of <i>this</i> non viral taxon name
218
     * @see     #getNameCache()
219
     */
220
    public String getInfraGenericEpithet();
221

  
222
    /**
223
     * Returns the species epithet string for <i>this</i> non viral taxon name if its {@link Rank rank} is
224
     * species aggregate or lower (bi- or trinomial). Species epithet strings
225
     * begin with a lower case letter.
226
     *
227
     * @return  the string containing the species epithet of <i>this</i> non viral taxon name
228
     * @see     #getNameCache()
229
     */
230
    public String getSpecificEpithet();
231

  
232
    /**
233
     * Returns the species subdivision epithet string (infraspecific part) for
234
     * <i>this</i> non viral taxon name if its {@link Rank rank} is infraspecific
235
     * (lower than species: trinomial). Species subdivision epithet strings
236
     * begin with a lower case letter.
237
     *
238
     * @return  the string containing the infraspecific part of <i>this</i> non viral taxon name
239
     * @see     #getNameCache()
240
     */
241
    public String getInfraSpecificEpithet();
242

  
243

  
244
    /**
245
     * Defines the last part of the name.
246
     * This is for infraspecific taxa, the infraspecific epithet,
247
     * for species the specific epithet, for infageneric taxa the infrageneric epithet
248
     * else the genusOrUninomial.
249
     * However, the result does not depend on the rank (which may be not correctly set
250
     * in case of dirty data) but returns the first name part which is not blank
251
     * considering the above order.
252
     * @return the first not blank name part in reverse order
253
     */
254
    public String getLastNamePart();
255

  
256
    /**
257
     * Returns or generates the nameCache (scientific name
258
     * without author strings and year) string for <i>this</i> non viral taxon name. If the
259
     * {@link #isProtectedNameCache() protectedNameCache} flag is not set (False)
260
     * the string will be generated according to a defined strategy,
261
     * otherwise the value of the actual nameCache string will be returned.
262
     *
263
     * @return  the string which identifies <i>this</i> non viral taxon name (without authors or year)
264
     * @see     #generateNameCache()
265
     */
266
    @Transient
267
    public String getNameCache() ;
268

  
269
    /**
270
     * Returns the hybrid child relationships ordered by relationship type, or if equal
271
     * by title cache of the related names.
272
     * @see #getHybridParentRelations()
273
     */
274
    @Transient
275
    public List<HybridRelationship> getOrderedChildRelationships();
276

  
277
    /**
278
     * Tests if the given name has any authors.
279
     * @return false if no author ((ex)combination or (ex)basionym) exists, true otherwise
280
     */
281
    public boolean hasAuthors();
282

  
283
    /**
284
     * Needs to be implemented by those classes that handle autonyms (e.g. botanical names).
285
     **/
286
   @Transient
287
   public boolean isAutonym();
288

  
289

  
290
   /**
291
    * Returns the boolean value of the flag indicating whether the name of <i>this</i>
292
    * botanical taxon name is a hybrid formula (true) or not (false). A hybrid
293
    * named by a hybrid formula (composed with its parent names by placing the
294
    * multiplication sign between them) does not have an own published name
295
    * and therefore has neither an {@link NonViralName#getAuthorshipCache() autorship}
296
    * nor other name components. If this flag is set no other hybrid flags may
297
    * be set.
298
    *
299
    * @return  the boolean value of the isHybridFormula flag
300
    * @see     #isMonomHybrid()
301
    * @see     #isBinomHybrid()
302
    * @see     #isTrinomHybrid()
303
    */
304
   public boolean isHybridFormula();
305

  
306
   /**
307
    * Returns the boolean value of the flag indicating whether <i>this</i> botanical
308
    * taxon name is the name of an intergeneric hybrid (true) or not (false).
309
    * In this case the multiplication sign is placed before the scientific
310
    * name. If this flag is set no other hybrid flags may be set.
311
    *
312
    * @return  the boolean value of the isMonomHybrid flag
313
    * @see     #isHybridFormula()
314
    * @see     #isBinomHybrid()
315
    * @see     #isTrinomHybrid()
316
    */
317
   public boolean isMonomHybrid();
318

  
319
   /**
320
    * Returns the boolean value of the flag indicating whether <i>this</i> botanical
321
    * taxon name is the name of an interspecific hybrid (true) or not (false).
322
    * In this case the multiplication sign is placed before the species
323
    * epithet. If this flag is set no other hybrid flags may be set.
324
    *
325
    * @return  the boolean value of the isBinomHybrid flag
326
    * @see     #isHybridFormula()
327
    * @see     #isMonomHybrid()
328
    * @see     #isTrinomHybrid()
329
    */
330
   public boolean isBinomHybrid();
331

  
332
   /**
333
    * Returns the boolean value of the flag indicating whether <i>this</i> botanical
334
    * taxon name is the name of an infraspecific hybrid (true) or not (false).
335
    * In this case the term "notho-" (optionally abbreviated "n-") is used as
336
    * a prefix to the term denoting the infraspecific rank of <i>this</i> botanical
337
    * taxon name. If this flag is set no other hybrid flags may be set.
338
    *
339
    * @return  the boolean value of the isTrinomHybrid flag
340
    * @see     #isHybridFormula()
341
    * @see     #isMonomHybrid()
342
    * @see     #isBinomHybrid()
343
    */
344
   public boolean isTrinomHybrid();
345

  
346

  
347
   /**
348
    * Returns the boolean value of the flag intended to protect (true)
349
    * or not (false) the {@link #getAuthorshipCache() authorshipCache} (complete authorship string)
350
    * of <i>this</i> non viral taxon name.
351
    *
352
    * @return  the boolean value of the protectedAuthorshipCache flag
353
    * @see     #getAuthorshipCache()
354
    */
355
   public boolean isProtectedAuthorshipCache();
356

  
357

  
358
   /**
359
    * Returns the boolean value of the flag intended to protect (true)
360
    * or not (false) the {@link #getNameCache() nameCache} (scientific name without author strings and year)
361
    * string of <i>this</i> non viral taxon name.
362
    *
363
    * @return  the boolean value of the protectedNameCache flag
364
    * @see     #getNameCache()
365
    */
366
   public boolean isProtectedNameCache();
367

  
368
   public void removeHybridChild(NonViralName child);
369

  
370
   public void removeHybridParent(NonViralName parent);
371

  
372
   /**
373
    * Removes one {@link HybridRelationship hybrid relationship} from the set of
374
    * {@link #getHybridRelationships() hybrid relationships} in which <i>this</i> botanical taxon name
375
    * is involved. The hybrid relationship will also be removed from the set
376
    * belonging to the second botanical taxon name involved.
377
    *
378
    * @param  relationship  the hybrid relationship which should be deleted from the corresponding sets
379
    * @see                  #getHybridRelationships()
380
    */
381
   public void removeHybridRelationship(HybridRelationship hybridRelation);
382

  
383
   /**
384
    * Assigns an authorshipCache string to <i>this</i> non viral taxon name. Sets the isProtectedAuthorshipCache
385
    * flag to <code>true</code>.
386
    *
387
    * @param  authorshipCache  the string which identifies the complete authorship of <i>this</i> non viral taxon name
388
    * @see    #getAuthorshipCache()
389
    */
390
   public void setAuthorshipCache(String authorshipCache);
391

  
392

  
393
   /**
394
    * Assigns an authorshipCache string to <i>this</i> non viral taxon name.
395
    *
396
    * @param  authorshipCache  the string which identifies the complete authorship of <i>this</i> non viral taxon name
397
    * @param  protectedAuthorshipCache if true the isProtectedAuthorshipCache flag is set to <code>true</code>, otherwise
398
    * the flag is set to <code>false</code>.
399
    * @see    #getAuthorshipCache()
400
    */
401
   public void setAuthorshipCache(String authorshipCache, boolean protectedAuthorshipCache);
402

  
403
   /**
404
    * @see  #getBasionymAuthorship()
405
    */
406
   public void setBasionymAuthorship(TeamOrPersonBase<?> basionymAuthorship);
407

  
408
   /**
409
    * @see  #isBinomHybrid()
410
    * @see  #isMonomHybrid()
411
    * @see  #isTrinomHybrid()
412
    */
413
   public void setBinomHybrid(boolean binomHybrid);
414

  
415

  
416
   /**
417
    * @see  #getCombinationAuthorship()
418
    */
419
   public void setCombinationAuthorship(TeamOrPersonBase<?> combinationAuthorship);
420

  
421
   /**
422
    * @see  #getExBasionymAuthorship()
423
    */
424
   public void setExBasionymAuthorship(TeamOrPersonBase<?> exBasionymAuthorship);
425

  
426

  
427
   /**
428
    * @see  #getExCombinationAuthorship()
429
    */
430
   public void setExCombinationAuthorship(TeamOrPersonBase<?> exCombinationAuthorship);
431

  
432
   /**
433
    * @see  #getGenusOrUninomial()
434
    */
435
   public void setGenusOrUninomial(String genusOrUninomial);
436

  
437
   /**
438
    * @see  #isHybridFormula()
439
    */
440
   public void setHybridFormula(boolean hybridFormula);
441

  
442
   /**
443
    * @see  #getInfraGenericEpithet()
444
    */
445
   public void setInfraGenericEpithet(String infraGenericEpithet);
446

  
447
   /**
448
    * @see  #getInfraSpecificEpithet()
449
    */
450
   public void setInfraSpecificEpithet(String infraSpecificEpithet);
451

  
452
   /**
453
    * @see  #isMonomHybrid()
454
    * @see  #isBinomHybrid()
455
    * @see  #isTrinomHybrid()
456
    */
457
   public void setMonomHybrid(boolean monomHybrid);
458

  
459
   /**
460
    * Assigns a nameCache string to <i>this</i> non viral taxon name and protects it from being overwritten.
461
    * Sets the protectedNameCache flag to <code>true</code>.
462
    *
463
    * @param  nameCache  the string which identifies <i>this</i> non viral taxon name (without authors or year)
464
    * @see    #getNameCache()
465
    */
466
   public void setNameCache(String nameCache);
467

  
468
   /**
469
    * Assigns a nameCache string to <i>this</i> non viral taxon name and protects it from being overwritten.
470
    * Sets the protectedNameCache flag to <code>true</code>.
471
    *
472
    * @param  nameCache  the string which identifies <i>this</i> non viral taxon name (without authors or year)
473
    * @param  protectedNameCache if true teh protectedNameCache is set to <code>true</code> or otherwise set to
474
    * <code>false</code>
475
    * @see    #getNameCache()
476
    */
477
   public void setNameCache(String nameCache, boolean protectedNameCache);
478

  
479
   /**
480
    * @see     #isProtectedAuthorshipCache()
481
    * @see     #getAuthorshipCache()
482
    */
483
   public void setProtectedAuthorshipCache(boolean protectedAuthorshipCache);
484

  
485
   /**
486
    * @see     #isProtectedNameCache()
487
    */
488
   public void setProtectedNameCache(boolean protectedNameCache);
489

  
490
   /**
491
    * @see  #getSpecificEpithet()
492
    */
493
   public void setSpecificEpithet(String specificEpithet);
494

  
495
   /**
496
    * @see  #isTrinomHybrid()
497
    * @see  #isBinomHybrid()
498
    * @see  #isMonomHybrid()
499
    */
500
   public void setTrinomHybrid(boolean trinomHybrid);
501

  
502

  
503
}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/ITaxonNameBase.java
1
/**
2
* Copyright (C) 2017 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
package eu.etaxonomy.cdm.model.name;
10

  
11
import java.util.List;
12
import java.util.Set;
13

  
14
import javax.persistence.Transient;
15

  
16
import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
17
import eu.etaxonomy.cdm.model.common.IParsable;
18
import eu.etaxonomy.cdm.model.common.IRelated;
19
import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
20
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
21
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
22
import eu.etaxonomy.cdm.model.reference.Reference;
23
import eu.etaxonomy.cdm.model.taxon.Synonym;
24
import eu.etaxonomy.cdm.model.taxon.Taxon;
25
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
26
import eu.etaxonomy.cdm.strategy.cache.TaggedText;
27
import eu.etaxonomy.cdm.strategy.match.IMatchable;
28

  
29
/**
30
 *
31
 * The upmost interface for taxon names.
32
 * <P>
33
 * This class corresponds partially to: <ul>
34
 * <li> TaxonName according to the TDWG ontology
35
 * <li> ScientificName and CanonicalName according to the TCS
36
 * <li> ScientificName according to the ABCD schema
37
 * </ul>
38
 *
39
 * @author a.mueller
40
 * @date 21.01.2017
41
 *
42
 */
43
public interface ITaxonNameBase<T extends TaxonNameBase<?,?>>
44
        extends IIdentifiableEntity, IParsable, IRelated, IMatchable, Cloneable{
45

  
46
    public String generateFullTitle();
47

  
48
    @Transient
49
    public String getFullTitleCache();
50

  
51
    @Transient
52
    public NomenclaturalCode getNomenclaturalCode();
53

  
54

  
55
    /**
56
     * Returns the boolean value "false" since the components of <i>this</i> taxon name
57
     * cannot follow the rules of a corresponding {@link NomenclaturalCode nomenclatural code}
58
     * which is not defined for this class. The nomenclature code depends on
59
     * the concrete name subclass ({@link BacterialName BacterialName},
60
     * {@link BotanicalName BotanicalName}, {@link CultivarPlantName CultivarPlantName},
61
     * {@link ZoologicalName ZoologicalName} or {@link ViralName ViralName})
62
     * to which a taxon name belongs.
63
     *
64
     * @return  false
65
     */
66
    @Transient
67
    public boolean isCodeCompliant();
68

  
69
    public List<TaggedText> getTaggedName();
70

  
71
    public void setFullTitleCache(String fullTitleCache);
72

  
73
    public void setFullTitleCache(String fullTitleCache, boolean protectCache);
74

  
75
    public boolean isProtectedFullTitleCache();
76

  
77
    void setProtectedFullTitleCache(boolean protectedFullTitleCache);
78

  
79
    /**
80
     * Returns the set of all {@link NameRelationship name relationships}
81
     * in which <i>this</i> taxon name is involved. A taxon name can be both source
82
     * in some name relationships or target in some others.
83
     *
84
     * @see    #getRelationsToThisName()
85
     * @see    #getRelationsFromThisName()
86
     * @see    #addNameRelationship(NameRelationship)
87
     * @see    #addRelationshipToName(TaxonNameBase, NameRelationshipType, String)
88
     * @see    #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
89
     */
90
    public Set<NameRelationship> getNameRelations();
91

  
92
    /**
93
     * Creates a new {@link NameRelationship#NameRelationship(TaxonNameBase, TaxonNameBase, NameRelationshipType, String) name relationship} from <i>this</i> taxon name to another taxon name
94
     * and adds it both to the set of {@link #getRelationsFromThisName() relations from <i>this</i> taxon name} and
95
     * to the set of {@link #getRelationsToThisName() relations to the other taxon name}.
96
     *
97
     * @param toName          the taxon name of the target for this new name relationship
98
     * @param type            the type of this new name relationship
99
     * @param ruleConsidered  the string which specifies the rule on which this name relationship is based
100
     * @see                   #getRelationsToThisName()
101
     * @see                   #getNameRelations()
102
     * @see                   #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
103
     * @see                   #addNameRelationship(NameRelationship)
104
     */
105
    public void addRelationshipToName(TaxonNameBase toName, NameRelationshipType type, String ruleConsidered);
106

  
107
    /**
108
     * Creates a new {@link NameRelationship#NameRelationship(TaxonNameBase, TaxonNameBase, NameRelationshipType, String) name relationship} from <i>this</i> taxon name to another taxon name
109
     * and adds it both to the set of {@link #getRelationsFromThisName() relations from <i>this</i> taxon name} and
110
     * to the set of {@link #getRelationsToThisName() relations to the other taxon name}.
111
     *
112
     * @param toName          the taxon name of the target for this new name relationship
113
     * @param type            the type of this new name relationship
114
     * @param ruleConsidered  the string which specifies the rule on which this name relationship is based
115
     * @return
116
     * @see                   #getRelationsToThisName()
117
     * @see                   #getNameRelations()
118
     * @see                   #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
119
     * @see                   #addNameRelationship(NameRelationship)
120
     */
121
    public NameRelationship addRelationshipToName(TaxonNameBase toName, NameRelationshipType type, Reference citation,
122
            String microCitation, String ruleConsidered);
123

  
124
    /**
125
     * Creates a new {@link NameRelationship#NameRelationship(TaxonNameBase, TaxonNameBase, NameRelationshipType, String) name relationship} from another taxon name to <i>this</i> taxon name
126
     * and adds it both to the set of {@link #getRelationsToThisName() relations to <i>this</i> taxon name} and
127
     * to the set of {@link #getRelationsFromThisName() relations from the other taxon name}.
128
     *
129
     * @param fromName        the taxon name of the source for this new name relationship
130
     * @param type            the type of this new name relationship
131
     * @param ruleConsidered  the string which specifies the rule on which this name relationship is based
132
     * @param citation        the reference in which this relation was described
133
     * @param microCitation   the reference detail for this relation (e.g. page)
134
     * @see                   #getRelationsFromThisName()
135
     * @see                   #getNameRelations()
136
     * @see                   #addRelationshipToName(TaxonNameBase, NameRelationshipType, String)
137
     * @see                   #addNameRelationship(NameRelationship)
138
     */
139
    public NameRelationship addRelationshipFromName(TaxonNameBase fromName, NameRelationshipType type, String ruleConsidered);
140

  
141
    /**
142
     * Creates a new {@link NameRelationship#NameRelationship(TaxonNameBase, TaxonNameBase, NameRelationshipType, String) name relationship} from another taxon name to <i>this</i> taxon name
143
     * and adds it both to the set of {@link #getRelationsToThisName() relations to <i>this</i> taxon name} and
144
     * to the set of {@link #getRelationsFromThisName() relations from the other taxon name}.
145
     *
146
     * @param fromName        the taxon name of the source for this new name relationship
147
     * @param type            the type of this new name relationship
148
     * @param ruleConsidered  the string which specifies the rule on which this name relationship is based
149
     * @param citation        the reference in which this relation was described
150
     * @param microCitation   the reference detail for this relation (e.g. page)
151
     * @see                   #getRelationsFromThisName()
152
     * @see                   #getNameRelations()
153
     * @see                   #addRelationshipToName(TaxonNameBase, NameRelationshipType, String)
154
     * @see                   #addNameRelationship(NameRelationship)
155
     */
156
    public NameRelationship addRelationshipFromName(TaxonNameBase fromName, NameRelationshipType type, Reference citation,
157
            String microCitation, String ruleConsidered);
158

  
159
    /**
160
     * Removes one {@link NameRelationship name relationship} from one of both sets of
161
     * {@link #getNameRelations() name relationships} in which <i>this</i> taxon name is involved.
162
     * The name relationship will also be removed from one of both sets belonging
163
     * to the second taxon name involved. Furthermore the fromName and toName
164
     * attributes of the name relationship object will be nullified.
165
     *
166
     * @param  nameRelation  the name relationship which should be deleted from one of both sets
167
     * @see                  #getNameRelations()
168
     */
169
    public void removeNameRelationship(NameRelationship nameRelation);
170

  
171
    public void removeRelationToTaxonName(TaxonNameBase toTaxonName);
172

  
173
    /**
174
     * Returns the set of all {@link NameRelationship name relationships}
175
     * in which <i>this</i> taxon name is involved as a source ("from"-side).
176
     *
177
     * @see    #getNameRelations()
178
     * @see    #getRelationsToThisName()
179
     * @see    #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
180
     */
181
    public Set<NameRelationship> getRelationsFromThisName();
182

  
183
    /**
184
     * Returns the set of all {@link NameRelationship name relationships}
185
     * in which <i>this</i> taxon name is involved as a target ("to"-side).
186
     *
187
     * @see    #getNameRelations()
188
     * @see    #getRelationsFromThisName()
189
     * @see    #addRelationshipToName(TaxonNameBase, NameRelationshipType, String)
190
     */
191
    public Set<NameRelationship> getRelationsToThisName();
192

  
193
    /**
194
     * Returns the set of {@link NomenclaturalStatus nomenclatural status} assigned
195
     * to <i>this</i> taxon name according to its corresponding nomenclature code.
196
     * This includes the {@link NomenclaturalStatusType type} of the nomenclatural status
197
     * and the nomenclatural code rule considered.
198
     *
199
     * @see     NomenclaturalStatus
200
     * @see     NomenclaturalStatusType
201
     */
202
    public Set<NomenclaturalStatus> getStatus();
203

  
204
    /**
205
     * Adds a new {@link NomenclaturalStatus nomenclatural status}
206
     * to <i>this</i> taxon name's set of nomenclatural status.
207
     *
208
     * @param  nomStatus  the nomenclatural status to be added
209
     * @see               #getStatus()
210
     */
211
    public void addStatus(NomenclaturalStatus nomStatus);
212

  
213
    public NomenclaturalStatus addStatus(NomenclaturalStatusType statusType, Reference citation, String microCitation);
214

  
215
    /**
216
     * Removes one element from the set of nomenclatural status of <i>this</i> taxon name.
217
     * Type and ruleConsidered attributes of the nomenclatural status object
218
     * will be nullified.
219
     *
220
     * @param  nomStatus  the nomenclatural status of <i>this</i> taxon name which should be deleted
221
     * @see               #getStatus()
222
     */
223
    public void removeStatus(NomenclaturalStatus nomStatus);
224

  
225
    /**
226
     * Indicates whether <i>this</i> taxon name is a {@link NameRelationshipType#BASIONYM() basionym}
227
     * or a {@link NameRelationshipType#REPLACED_SYNONYM() replaced synonym}
228
     * of any other taxon name. Returns "true", if a basionym or a replaced
229
     * synonym {@link NameRelationship relationship} from <i>this</i> taxon name to another taxon name exists,
230
     * false otherwise (also in case <i>this</i> taxon name is the only one in the
231
     * homotypical group).
232
     */
233
    public boolean isOriginalCombination();
234

  
235
    /**
236
     * Indicates <i>this</i> taxon name is a {@link NameRelationshipType#REPLACED_SYNONYM() replaced synonym}
237
     * of any other taxon name. Returns "true", if a replaced
238
     * synonym {@link NameRelationship relationship} from <i>this</i> taxon name to another taxon name exists,
239
     * false otherwise (also in case <i>this</i> taxon name is the only one in the
240
     * homotypical group).
241
     */
242
    public boolean isReplacedSynonym();
243

  
244
    /**
245
     * Returns the taxon name which is the {@link NameRelationshipType#BASIONYM() basionym} of <i>this</i> taxon name.
246
     * The basionym of a taxon name is its epithet-bringing synonym.
247
     * For instance <i>Pinus abies</i> L. was published by Linnaeus and the botanist
248
     * Karsten transferred later <i>this</i> taxon to the genus Picea. Therefore,
249
     * <i>Pinus abies</i> L. is the basionym of the new combination <i>Picea abies</i> (L.) H. Karst.
250
     *
251
     * If more than one basionym exists one is choosen at radom.
252
     *
253
     * If no basionym exists null is returned.
254
     */
255
    public TaxonNameBase getBasionym();
256

  
257
    /**
258
     * Returns the set of taxon names which are the {@link NameRelationshipType#BASIONYM() basionyms} of <i>this</i> taxon name.
259
     * The basionym of a taxon name is its epithet-bringing synonym.
260
     * For instance <i>Pinus abies</i> L. was published by Linnaeus and the botanist
261
     * Karsten transferred later <i>this</i> taxon to the genus Picea. Therefore,
262
     * <i>Pinus abies</i> L. is the basionym of the new combination <i>Picea abies</i> (L.) H. Karst.
263
     */
264
    public Set<TaxonNameBase> getBasionyms();
265

  
266
    /**
267
     * Assigns a taxon name as {@link NameRelationshipType#BASIONYM() basionym} of <i>this</i> taxon name.
268
     * The basionym {@link NameRelationship relationship} will be added to <i>this</i> taxon name
269
     * and to the basionym. The basionym cannot have itself a basionym.
270
     * The {@link HomotypicalGroup homotypical groups} of <i>this</i> taxon name and of the basionym
271
     * will be {@link HomotypicalGroup#merge(HomotypicalGroup) merged}.
272
     *
273
     * @param  basionym     the taxon name to be set as the basionym of <i>this</i> taxon name
274
     * @see                 #getBasionym()
275
     * @see                 #addBasionym(TaxonNameBase, String)
276
     */
277
    public void addBasionym(T basionym);
278

  
279
    /**
280
     * Assigns a taxon name as {@link NameRelationshipType#BASIONYM() basionym} of <i>this</i> taxon name
281
     * and keeps the nomenclatural rule considered for it. The basionym
282
     * {@link NameRelationship relationship} will be added to <i>this</i> taxon name and to the basionym.
283
     * The basionym cannot have itself a basionym.
284
     * The {@link HomotypicalGroup homotypical groups} of <i>this</i> taxon name and of the basionym
285
     * will be {@link HomotypicalGroup#merge(HomotypicalGroup) merged}.
286
     *
287
     * @param  basionym         the taxon name to be set as the basionym of <i>this</i> taxon name
288
     * @param  ruleConsidered   the string identifying the nomenclatural rule
289
     * @return
290
     * @see                     #getBasionym()
291
     * @see                     #addBasionym(TaxonNameBase)
292
     */
293
    public NameRelationship addBasionym(T basionym, Reference citation, String microcitation, String ruleConsidered);
294

  
295
    /**
296
     * Returns the set of taxon names which are the {@link NameRelationshipType#REPLACED_SYNONYM() replaced synonyms} of <i>this</i> taxon name.
297
     *
298
     */
299
    public Set<TaxonNameBase> getReplacedSynonyms();
300

  
301
    /**
302
     * Assigns a taxon name as {@link NameRelationshipType#REPLACED_SYNONYM() replaced synonym} of <i>this</i> taxon name
303
     * and keeps the nomenclatural rule considered for it. The replaced synonym
304
     * {@link NameRelationship relationship} will be added to <i>this</i> taxon name and to the replaced synonym.
305
     * The {@link HomotypicalGroup homotypical groups} of <i>this</i> taxon name and of the replaced synonym
306
     * will be {@link HomotypicalGroup#merge(HomotypicalGroup) merged}.
307
     *
308
     * @param  basionym         the taxon name to be set as the basionym of <i>this</i> taxon name
309
     * @param  ruleConsidered   the string identifying the nomenclatural rule
310
     * @see                     #getBasionym()
311
     * @see                     #addBasionym(TaxonNameBase)
312
     */
313
    //TODO: Check if true: The replaced synonym cannot have itself a replaced synonym (?).
314
    public void addReplacedSynonym(T replacedSynonym, Reference citation, String microcitation, String ruleConsidered);
315

  
316
    /**
317
     * Removes the {@link NameRelationshipType#BASIONYM() basionym} {@link NameRelationship relationship} from the set of
318
     * {@link #getRelationsToThisName() name relationships to} <i>this</i> taxon name. The same relationhip will be
319
     * removed from the set of {@link #getRelationsFromThisName() name relationships from} the taxon name
320
     * previously used as basionym.
321
     *
322
     * @see   #getBasionym()
323
     * @see   #addBasionym(TaxonNameBase)
324
     */
325
    public void removeBasionyms();
326

  
327
    /**
328
     * Returns the taxonomic {@link Rank rank} of <i>this</i> taxon name.
329
     *
330
     * @see     Rank
331
     */
332
    public Rank getRank();
333

  
334
    /**
335
     * @see  #getRank()
336
     */
337
    public void setRank(Rank rank);
338

  
339
    /**
340
     * Returns the {@link eu.etaxonomy.cdm.model.reference.INomenclaturalReference nomenclatural reference} of <i>this</i> taxon name.
341
     * The nomenclatural reference is here meant to be the one publication
342
     * <i>this</i> taxon name was originally published in while fulfilling the formal
343
     * requirements as specified by the corresponding {@link NomenclaturalCode nomenclatural code}.
344
     *
345
     * @see     eu.etaxonomy.cdm.model.reference.INomenclaturalReference
346
     * @see     eu.etaxonomy.cdm.model.reference.Reference
347
     */
348
    public INomenclaturalReference getNomenclaturalReference();
349

  
350
    /**
351
     * Assigns a {@link eu.etaxonomy.cdm.model.reference.INomenclaturalReference nomenclatural reference} to <i>this</i> taxon name.
352
     * The corresponding {@link eu.etaxonomy.cdm.model.reference.Reference.isNomenclaturallyRelevant nomenclaturally relevant flag} will be set to true
353
     * as it is obviously used for nomenclatural purposes.
354
     *
355
     * @throws IllegalArgumentException if parameter <code>nomenclaturalReference</code> is not assignable from {@link INomenclaturalReference}
356
     * @see  #getNomenclaturalReference()
357
     */
358
    public void setNomenclaturalReference(INomenclaturalReference nomenclaturalReference);
359

  
360
    /**
361
     * Returns the appended phrase string assigned to <i>this</i> taxon name.
362
     * The appended phrase is a non-atomised addition to a name. It is
363
     * not ruled by a nomenclatural code.
364
     */
365
    public String getAppendedPhrase();
366

  
367
    /**
368
     * @see  #getAppendedPhrase()
369
     */
370
    public void setAppendedPhrase(String appendedPhrase);
371

  
372
    /**
373
     * Returns the details string of the {@link #getNomenclaturalReference() nomenclatural reference} assigned
374
     * to <i>this</i> taxon name. The details describe the exact localisation within
375
     * the publication used as nomenclature reference. These are mostly
376
     * (implicitly) pages but can also be figures or tables or any other
377
     * element of a publication. A nomenclatural micro reference (details)
378
     * requires the existence of a nomenclatural reference.
379
     */
380
    //Details of the nomenclatural reference (protologue).
381
    public String getNomenclaturalMicroReference();
382

  
383
    /**
384
     * @see  #getNomenclaturalMicroReference()
385
     */
386
    public void setNomenclaturalMicroReference(String nomenclaturalMicroReference);
387

  
388
    /**
389
     * @param warnings
390
     */
391
    public void addParsingProblems(int problems);
392

  
393
    /**
394
     * Returns the set of {@link TypeDesignationBase type designations} assigned
395
     * to <i>this</i> taxon name.
396
     * @see     NameTypeDesignation
397
     * @see     SpecimenTypeDesignation
398
     */
399
    public Set<TypeDesignationBase> getTypeDesignations();
400

  
401
    /**
402
     * Removes one element from the set of {@link TypeDesignationBase type designations} assigned to
403
     * <i>this</i> taxon name. The type designation itself will be nullified.
404
     *
405
     * @param  typeDesignation  the type designation which should be deleted
406
     */
407
    public void removeTypeDesignation(TypeDesignationBase typeDesignation);
408

  
409
    /**
410
     * Returns the set of {@link SpecimenTypeDesignation specimen type designations} assigned
411
     * to <i>this</i> taxon name. The {@link Rank rank} of <i>this</i> taxon name is generally
412
     * "species" or below. The specimen type designations include all the
413
     * specimens on which the typification of this name is based (which are
414
     * exclusively used to typify taxon names belonging to the same
415
     * {@link HomotypicalGroup homotypical group} to which <i>this</i> taxon name
416
     * belongs) and eventually the status of these designations.
417
     *
418
     * @see     SpecimenTypeDesignation
419
     * @see     NameTypeDesignation
420
     * @see     HomotypicalGroup
421
     */
422
    public Set<SpecimenTypeDesignation> getSpecimenTypeDesignationsOfHomotypicalGroup();
423

  
424
    /**
425
     * Returns the set of {@link NameTypeDesignation name type designations} assigned
426
     * to <i>this</i> taxon name the rank of which must be above "species".
427
     * The name type designations include all the taxon names used to typify
428
     * <i>this</i> taxon name and eventually the rejected or conserved status
429
     * of these designations.
430
     *
431
     * @see     NameTypeDesignation
432
     * @see     SpecimenTypeDesignation
433
     */
434
    public Set<NameTypeDesignation> getNameTypeDesignations();
435

  
436
    /**
437
     * Creates and adds a new {@link NameTypeDesignation name type designation}
438
     * to <i>this</i> taxon name's set of type designations.
439
     *
440
     * @param  typeSpecies              the taxon name to be used as type of <i>this</i> taxon name
441
     * @param  citation                 the reference for this new designation
442
     * @param  citationMicroReference   the string with the details (generally pages) within the reference
443
     * @param  originalNameString       the taxon name string used in the reference to assert this designation
444
     * @param  isRejectedType           the boolean status for a rejected name type designation
445
     * @param  isConservedType          the boolean status for a conserved name type designation
446
     * @param  isLectoType              the boolean status for a lectotype name type designation
447
     * @param  isNotDesignated          the boolean status for a name type designation without name type
448
     * @param  addToAllHomotypicNames   the boolean indicating whether the name type designation should be
449
     *                                  added to all taxon names of the homotypical group this taxon name belongs to
450
     * @return
451
     * @see                             #getNameTypeDesignations()
452
     * @see                             NameTypeDesignation
453
     * @see                             TypeDesignationBase#isNotDesignated()
454
     */
455
    public NameTypeDesignation addNameTypeDesignation(TaxonNameBase typeSpecies, Reference citation,
456
            String citationMicroReference, String originalNameString, NameTypeDesignationStatus status,
457
            boolean isRejectedType, boolean isConservedType,
458
            /*boolean isLectoType, */
459
            boolean isNotDesignated, boolean addToAllHomotypicNames);
460

  
461
    /**
462
     * Creates and adds a new {@link NameTypeDesignation name type designation}
463
     * to <i>this</i> taxon name's set of type designations.
464
     *
465
     * @param  typeSpecies              the taxon name to be used as type of <i>this</i> taxon name
466
     * @param  citation                 the reference for this new designation
467
     * @param  citationMicroReference   the string with the details (generally pages) within the reference
468
     * @param  originalNameString       the taxon name string used in the reference to assert this designation
469
     * @param  status                   the name type designation status
470
     * @param  addToAllHomotypicNames   the boolean indicating whether the name type designation should be
471
     *                                  added to all taxon names of the homotypical group this taxon name belongs to
472
     * @return
473
     * @see                             #getNameTypeDesignations()
474
     * @see                             NameTypeDesignation
475
     * @see                             TypeDesignationBase#isNotDesignated()
476
     */
477
    public NameTypeDesignation addNameTypeDesignation(TaxonNameBase typeSpecies, Reference citation,
478
            String citationMicroReference, String originalNameString, NameTypeDesignationStatus status,
479
            boolean addToAllHomotypicNames);
480

  
481
    /**
482
     * Returns the set of {@link SpecimenTypeDesignation specimen type designations}
483
     * that typify <i>this</i> taxon name.
484
     */
485
    public Set<SpecimenTypeDesignation> getSpecimenTypeDesignations();
486

  
487
    /**
488
     * Creates and adds a new {@link SpecimenTypeDesignation specimen type designation}
489
     * to <i>this</i> taxon name's set of type designations.
490
     *
491
     * @param  typeSpecimen             the specimen to be used as a type for <i>this</i> taxon name
492
     * @param  status                   the specimen type designation status
493
     * @param  citation                 the reference for this new specimen type designation
494
     * @param  citationMicroReference   the string with the details (generally pages) within the reference
495
     * @param  originalNameString       the taxon name used in the reference to assert this designation
496
     * @param  isNotDesignated          the boolean status for a specimen type designation without specimen type
497
     * @param  addToAllHomotypicNames   the boolean indicating whether the specimen type designation should be
498
     *                                  added to all taxon names of the homotypical group the typified
499
     *                                  taxon name belongs to
500
     * @return
501
     * @see                             #getSpecimenTypeDesignations()
502
     * @see                             SpecimenTypeDesignationStatus
503
     * @see                             SpecimenTypeDesignation
504
     * @see                             TypeDesignationBase#isNotDesignated()
505
     */
506
    public SpecimenTypeDesignation addSpecimenTypeDesignation(DerivedUnit typeSpecimen, SpecimenTypeDesignationStatus status,
507
            Reference citation, String citationMicroReference, String originalNameString, boolean isNotDesignated,
508
            boolean addToAllHomotypicNames);
509

  
510
    /**
511
     * Adds a {@link TypeDesignationBase type designation} to <code>this</code> taxon name's set of type designations
512
     *
513
     * @param typeDesignation           the typeDesignation to be added to <code>this</code> taxon name
514
     * @param addToAllNames             the boolean indicating whether the type designation should be
515
     *                                  added to all taxon names of the homotypical group the typified
516
     *                                  taxon name belongs to
517
     * @return                          true if the operation was succesful
518
     *
519
     * @throws IllegalArgumentException if the type designation already has typified names, an {@link IllegalArgumentException exception}
520
     *                                  is thrown. We do this to prevent a type designation to be used for multiple taxon names.
521
     *
522
     */
523
    public boolean addTypeDesignation(TypeDesignationBase typeDesignation, boolean addToAllNames);
524

  
525
    /**
526
     * Returns the {@link HomotypicalGroup homotypical group} to which
527
     * <i>this</i> taxon name belongs. A homotypical group represents all taxon names
528
     * that share the same types.
529
     *
530
     * @see     HomotypicalGroup
531
     */
532

  
533
    public HomotypicalGroup getHomotypicalGroup();
534

  
535
    /**
536
     * @see #getHomotypicalGroup()
537
     */
538
    public void setHomotypicalGroup(HomotypicalGroup homotypicalGroup);
539

  
540
    /**
541
     * Returns the complete string containing the
542
     * {@link eu.etaxonomy.cdm.model.reference.INomenclaturalReference#getNomenclaturalCitation() nomenclatural reference citation}
543
     * and the {@link #getNomenclaturalMicroReference() details} assigned to <i>this</i> taxon name.
544
     *
545
     * @return  the string containing the nomenclatural reference of <i>this</i> taxon name
546
     * @see     eu.etaxonomy.cdm.model.reference.INomenclaturalReference#getNomenclaturalCitation()
547
     * @see     #getNomenclaturalReference()
548
     * @see     #getNomenclaturalMicroReference()
549
     */
550
    public String getCitationString();
551

  
552
    /**
553
     * Returns the string containing the publication date (generally only year)
554
     * of the {@link #getNomenclaturalReference() nomenclatural reference} for <i>this</i> taxon name, null if there is
555
     * no nomenclatural reference.
556
     *
557
     * @return  the string containing the publication date of <i>this</i> taxon name
558
     * @see     eu.etaxonomy.cdm.model.reference.INomenclaturalReference#getYear()
559
     */
560
    public String getReferenceYear();
561

  
562
    /**
563
     * Returns the set of {@link eu.etaxonomy.cdm.model.taxon.TaxonBase taxon bases} that refer to <i>this</i> taxon name.
564
     * In this context a taxon base means the use of a taxon name by a reference
565
     * either as a {@link eu.etaxonomy.cdm.model.taxon.Taxon taxon} ("accepted/correct" name) or
566
     * as a (junior) {@link eu.etaxonomy.cdm.model.taxon.Synonym synonym}.
567
     * A taxon name can be used by several distinct {@link eu.etaxonomy.cdm.model.reference.Reference references} but only once
568
     * within a taxonomic treatment (identified by one reference).
569
     *
570
     * @see #getTaxa()
571
     * @see #getSynonyms()
572
     */
573
    public Set<TaxonBase> getTaxonBases();
574

  
575
    /**
576
     * Adds a new {@link eu.etaxonomy.cdm.model.taxon.TaxonBase taxon base}
577
     * to the set of taxon bases using <i>this</i> taxon name.
578
     *
579
     * @param  taxonBase  the taxon base to be added
580
     * @see               #getTaxonBases()
581
     * @see               #removeTaxonBase(TaxonBase)
582
     */
583
    //TODO protected
584
    public void addTaxonBase(TaxonBase taxonBase);
585

  
586
    /**
587
     * Removes one element from the set of {@link eu.etaxonomy.cdm.model.taxon.TaxonBase taxon bases} that refer to <i>this</i> taxon name.
588
     *
589
     * @param  taxonBase    the taxon base which should be removed from the corresponding set
590
     * @see                 #getTaxonBases()
591
     * @see                 #addTaxonBase(TaxonBase)
592
     */
593
    public void removeTaxonBase(TaxonBase taxonBase);
594

  
595
    /**
596
     * Returns the set of {@link eu.etaxonomy.cdm.model.taxon.Taxon taxa} ("accepted/correct" names according to any
597
     * reference) that are based on <i>this</i> taxon name. This set is a subset of
598
     * the set returned by getTaxonBases().
599
     *
600
     * @see eu.etaxonomy.cdm.model.taxon.Taxon
601
     * @see #getTaxonBases()
602
     * @see #getSynonyms()
603
     */
604
    public Set<Taxon> getTaxa();
605

  
606
    /**
607
     * Returns the set of {@link eu.etaxonomy.cdm.model.taxon.Synonym (junior) synonyms} (according to any
608
     * reference) that are based on <i>this</i> taxon name. This set is a subset of
609
     * the set returned by getTaxonBases().
610
     *
611
     * @see eu.etaxonomy.cdm.model.taxon.Synonym
612
     * @see #getTaxonBases()
613
     * @see #getTaxa()
614
     */
615
    public Set<Synonym> getSynonyms();
616

  
617
    /**
618
     * Returns the set of {@link eu.etaxonomy.cdm.model.description.TaxonNameDescription taxon name descriptions} assigned
619
     * to <i>this</i> taxon name. A taxon name description is a piece of information
620
     * concerning the taxon name like for instance the content of its first
621
     * publication (protolog) or a picture of this publication.
622
     *
623
     * @see #addDescription(TaxonNameDescription)
624
     * @see #removeDescription(TaxonNameDescription)
625
     * @see eu.etaxonomy.cdm.model.description.TaxonNameDescription
626
     */
627
    public Set<TaxonNameDescription> getDescriptions();
628

  
629
    /**
630
     * Adds a new {@link eu.etaxonomy.cdm.model.description.TaxonNameDescription taxon name description}
631
     * to the set of taxon name descriptions assigned to <i>this</i> taxon name. The
632
     * content of the {@link eu.etaxonomy.cdm.model.description.TaxonNameDescription#getTaxonName() taxonName attribute} of the
633
     * taxon name description itself will be replaced with <i>this</i> taxon name.
634
     *
635
     * @param  description  the taxon name description to be added
636
     * @see                 #getDescriptions()
637
     * @see                 #removeDescription(TaxonNameDescription)
638
     */
639
    public void addDescription(TaxonNameDescription description);
640

  
641
    /**
642
     * Removes one element from the set of {@link eu.etaxonomy.cdm.model.description.TaxonNameDescription taxon name descriptions} assigned
643
     * to <i>this</i> taxon name. The content of the {@link eu.etaxonomy.cdm.model.description.TaxonNameDescription#getTaxonName() taxonName attribute}
644
     * of the description itself will be set to "null".
645
     *
646
     * @param  description  the taxon name description which should be removed
647
     * @see                 #getDescriptions()
648
     * @see                 #addDescription(TaxonNameDescription)
649
     * @see                 eu.etaxonomy.cdm.model.description.TaxonNameDescription#getTaxonName()
650
     */
651
    public void removeDescription(TaxonNameDescription description);
652

  
653
    public void mergeHomotypicGroups(TaxonNameBase name);
654

  
655
    /**
656
     * Returns the boolean value indicating whether a given taxon name belongs
657
     * to the same {@link HomotypicalGroup homotypical group} as <i>this</i> taxon name (true)
658
     * or not (false). Returns "true" only if the homotypical groups of both
659
     * taxon names exist and if they are identical.
660
     *
661
     * @param   homoTypicName  the taxon name the homotypical group of which is to be checked
662
     * @return                 the boolean value of the check
663
     * @see                    HomotypicalGroup
664
     */
665
    public boolean isHomotypic(TaxonNameBase homoTypicName);
666

  
667
    /**
668
     * Checks whether name is a basionym for ALL names
669
     * in its homotypical group.
670
     * Returns <code>false</code> if there are no other names in the group
671
     * @param name
672
     * @return
673
     */
674
    public boolean isGroupsBasionym();
675

  
676
    /**
677
     * Checks whether a basionym relationship exists between fromName and toName.
678
     *
679
     * @param fromName
680
     * @param toName
681
     * @return
682
     */
683
    public boolean isBasionymFor(TaxonNameBase newCombinationName);
684

  
685
    /**
686
     * Creates a basionym relationship to all other names in this names homotypical
687
     * group.
688
     *
689
     * @see HomotypicalGroup.setGroupBasionym(TaxonNameBase basionymName)
690
     */
691
    public void makeGroupsBasionym();
692

  
693
    //*********  Rank comparison shortcuts   ********************//
694
    /**
695
     * Returns the boolean value indicating whether the taxonomic {@link Rank rank} of <i>this</i>
696
     * taxon name is higher than the genus rank (true) or not (false).
697
     * Suprageneric non viral names are monomials.
698
     * Returns false if rank is null.
699
     *
700
     * @see  #isGenus()
701
     * @see  #isInfraGeneric()
702
     * @see  #isSpecies()
703
     * @see  #isInfraSpecific()
704
     */
705
    public boolean isSupraGeneric();
706

  
707
    /**
708
     * Returns the boolean value indicating whether the taxonomic {@link Rank rank} of <i>this</i>
709
     * taxon name is the genus rank (true) or not (false). Non viral names with
710
     * genus rank are monomials. Returns false if rank is null.
711
     *
712
     * @see  #isSupraGeneric()
713
     * @see  #isInfraGeneric()
714
     * @see  #isSpecies()
715
     * @see  #isInfraSpecific()
716
     */
717
    public boolean isGenus();
718

  
719
    /**
720
     * Returns the boolean value indicating whether the taxonomic {@link Rank rank} of <i>this</i>
721
     * taxon name is higher than the species rank and lower than the
722
     * genus rank (true) or not (false). Infrageneric non viral names are
723
     * binomials. Returns false if rank is null.
724
     *
725
     * @see  #isSupraGeneric()
726
     * @see  #isGenus()
727
     * @see  #isSpecies()
728
     * @see  #isInfraSpecific()
729
     */
730
    public boolean isInfraGeneric();
731

  
732
    /**
733
     * Returns the boolean value indicating whether the taxonomic {@link Rank rank} of <i>this</i>
734
     * taxon name is higher than the species rank (true) or not (false).
735
     * Returns false if rank is null.
736
     *
737
     * @see  #isGenus()
738
     * @see  #isInfraGeneric()
739
     * @see  #isSpecies()
740
     * @see  #isInfraSpecific()
741
     */
742
    public boolean isSupraSpecific();
743

  
744
    /**
745
     * Returns the boolean value indicating whether the taxonomic {@link Rank rank} of <i>this</i>
746
     * taxon name is the species rank (true) or not (false). Non viral names
747
     * with species rank are binomials.
748
     * Returns false if rank is null.
749
     *
750
     * @see  #isSupraGeneric()
751
     * @see  #isGenus()
752
     * @see  #isInfraGeneric()
753
     * @see  #isInfraSpecific()
754
     */
755
    public boolean isSpecies();
756

  
757
    /**
758
     * Returns the boolean value indicating whether the taxonomic {@link Rank rank} of <i>this</i>
759
     * taxon name is lower than the species rank (true) or not (false).
760
     * Infraspecific non viral names are trinomials.
761
     * Returns false if rank is null.
762
     *
763
     * @see  #isSupraGeneric()
764
     * @see  #isGenus()
765
     * @see  #isInfraGeneric()
766
     * @see  #isSpecies()
767
     */
768
    public boolean isInfraSpecific();
769

  
770
    /**
771
     * Returns true if this name's rank indicates a rank that aggregates species like species
772
     * aggregates or species groups, false otherwise. This methods currently returns false
773
     * for all user defined ranks.
774
     *
775
     *@see Rank#isSpeciesAggregate()
776
     *
777
     * @return
778
     */
779
    public boolean isSpeciesAggregate();
780

  
781
    /**
782
     * Creates a basionym relationship between this name and
783
     *  each name in its homotypic group.
784
     *
785
     * @param basionymName
786
     */
787
    public void setAsGroupsBasionym();
788

  
789
    /**
790
     * Removes basionym relationship between this name and
791
     *  each name in its homotypic group.
792
     *
793
     * @param basionymName
794
     */
795
    public void removeAsGroupsBasionym();
796

  
797

  
798
}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/NonViralName.java
56 56
@CorrectEpithetsForRank(groups = Level2.class)
57 57
@NameMustHaveAuthority(groups = Level2.class)
58 58
@NoDuplicateNames(groups = Level3.class)
59
public class NonViralName<T extends NonViralName> extends TaxonNameBase<T, INonViralNameCacheStrategy> implements Cloneable{
59
public class NonViralName<T extends NonViralName>
60
        extends TaxonNameBase<T, INonViralNameCacheStrategy>
61
        implements INonViralName<T>{
62

  
60 63
    private static final long serialVersionUID = 4441110073881088033L;
61 64

  
62 65

  
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TaxonNameBase.java
150 150
@Table(appliesTo="TaxonNameBase", indexes = { @org.hibernate.annotations.Index(name = "taxonNameBaseTitleCacheIndex", columnNames = { "titleCache" }),  @org.hibernate.annotations.Index(name = "taxonNameBaseNameCacheIndex", columnNames = { "nameCache" }) })
151 151
public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INameCacheStrategy>
152 152
            extends IdentifiableEntity<S>
153
            implements IParsable, IRelated, IMatchable, Cloneable {
153
            implements ITaxonNameBase<T>, IParsable, IRelated, IMatchable, Cloneable {
154 154

  
155 155
    private static final long serialVersionUID = -4530368639601532116L;
156 156
    private static final Logger logger = Logger.getLogger(TaxonNameBase.class);
......
956 956
        this.hybridChildRelations = hybridChildRelations;
957 957
    }
958 958

  
959
    @Override
959 960
    public boolean isProtectedFullTitleCache() {
960 961
        return protectedFullTitleCache;
961 962
    }
962 963

  
964
    @Override
963 965
    public void setProtectedFullTitleCache(boolean protectedFullTitleCache) {
964 966
        this.protectedFullTitleCache = protectedFullTitleCache;
965 967
    }
......
1126 1128

  
1127 1129
//********* METHODS **************************************/
1128 1130

  
1131
    @Override
1129 1132
    public String generateFullTitle(){
1130 1133
        if (cacheStrategy == null){
1131 1134
            logger.warn("No CacheStrategy defined for nonViralName: " + this.getUuid());
......
1136 1139
    }
1137 1140

  
1138 1141

  
1142
    @Override
1139 1143
    public void setFullTitleCache(String fullTitleCache){
1140 1144
        setFullTitleCache(fullTitleCache, PROTECTED);
1141 1145
    }
1142 1146

  
1147
    @Override
1143 1148
    public void setFullTitleCache(String fullTitleCache, boolean protectCache){
1144 1149
        fullTitleCache = getTruncatedCache(fullTitleCache);
1145 1150
        this.fullTitleCache = fullTitleCache;
......
1165 1170
     *
1166 1171
     * @return  false
1167 1172
     */
1173
    @Override
1168 1174
    @Transient
1169 1175
    public boolean isCodeCompliant() {
1170 1176
        //FIXME
......
1172 1178
        return false;
1173 1179
    }
1174 1180

  
1181
    @Override
1175 1182
    @Transient
1176 1183
    public List<TaggedText> getTaggedName(){
1177 1184
        return getCacheStrategy().getTaggedTitle(this);
1178 1185
    }
1179 1186

  
1187
    @Override
1180 1188
    @Transient
1181 1189
    public String getFullTitleCache(){
1182 1190
        if (protectedFullTitleCache){
......
1356 1364
     * @see    #addRelationshipToName(TaxonNameBase, NameRelationshipType, String)
1357 1365
     * @see    #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
1358 1366
     */
1367
    @Override
1359 1368
    @Transient
1360 1369
    public Set<NameRelationship> getNameRelations() {
1361 1370
        Set<NameRelationship> rels = new HashSet<NameRelationship>();
......
1377 1386
     * @see    				  #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
1378 1387
     * @see    				  #addNameRelationship(NameRelationship)
1379 1388
     */
1389
    @Override
1380 1390
    public void addRelationshipToName(TaxonNameBase toName, NameRelationshipType type, String ruleConsidered){
1381 1391
        addRelationshipToName(toName, type, null, null, ruleConsidered);
1382 1392
        //		NameRelationship rel = new NameRelationship(toName, this, type, ruleConsidered);
......
1396 1406
     * @see    				  #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
1397 1407
     * @see    				  #addNameRelationship(NameRelationship)
1398 1408
     */
1409
    @Override
1399 1410
    public NameRelationship addRelationshipToName(TaxonNameBase toName, NameRelationshipType type, Reference citation, String microCitation, String ruleConsidered){
1400 1411
        if (toName == null){
1401 1412
            throw new NullPointerException("Null is not allowed as name for a name relationship");
......
1419 1430
     * @see    				  #addRelationshipToName(TaxonNameBase, NameRelationshipType, String)
1420 1431
     * @see    				  #addNameRelationship(NameRelationship)
1421 1432
     */
1433
    @Override
1422 1434
    public NameRelationship addRelationshipFromName(TaxonNameBase fromName, NameRelationshipType type, String ruleConsidered){
1423 1435
        //fromName.addRelationshipToName(this, type, null, null, ruleConsidered);
1424 1436
        return this.addRelationshipFromName(fromName, type, null, null, ruleConsidered);
......
1438 1450
     * @see    				  #addRelationshipToName(TaxonNameBase, NameRelationshipType, String)
1439 1451
     * @see    				  #addNameRelationship(NameRelationship)
1440 1452
     */
1453
    @Override
1441 1454
    public NameRelationship addRelationshipFromName(TaxonNameBase fromName, NameRelationshipType type, Reference citation, String microCitation, String ruleConsidered){
1442 1455
        return fromName.addRelationshipToName(this, type, citation, microCitation, ruleConsidered);
1443 1456
    }
......
1479 1492
     * @param  nameRelation  the name relationship which should be deleted from one of both sets
1480 1493
     * @see    				 #getNameRelations()
1481 1494
     */
1495
    @Override
1482 1496
    public void removeNameRelationship(NameRelationship nameRelation) {
1483 1497

  
1484 1498
        TaxonNameBase fromName = nameRelation.getFromName();
......
1501 1515
        this.relationsFromThisName.remove(nameRelation);
1502 1516
    }
1503 1517

  
1518
    @Override
1504 1519
    public void removeRelationToTaxonName(TaxonNameBase toTaxonName) {
1505 1520
        Set<NameRelationship> nameRelationships = new HashSet<NameRelationship>();
1506 1521
//		nameRelationships.addAll(this.getNameRelations());
......
1551 1566
     * @see    #getRelationsToThisName()
1552 1567
     * @see    #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
1553 1568
     */
1569
    @Override
1554 1570
    public Set<NameRelationship> getRelationsFromThisName() {
1555 1571
        if(relationsFromThisName == null) {
1556 1572
            this.relationsFromThisName = new HashSet<>();
......
1566 1582
     * @see    #getRelationsFromThisName()
1567 1583
     * @see    #addRelationshipToName(TaxonNameBase, NameRelationshipType, String)
1568 1584
     */
1585
    @Override
1569 1586
    public Set<NameRelationship> getRelationsToThisName() {
1570 1587
        if(relationsToThisName == null) {
1571 1588
            this.relationsToThisName = new HashSet<>();
......
1582 1599
     * @see     NomenclaturalStatus
1583 1600
     * @see     NomenclaturalStatusType
1584 1601
     */
1602
    @Override
1585 1603
    public Set<NomenclaturalStatus> getStatus() {
1586 1604
        if(status == null) {
1587 1605
            this.status = new HashSet<>();
......
1596 1614
     * @param  nomStatus  the nomenclatural status to be added
1597 1615
     * @see 			  #getStatus()
1598 1616
     */
1617
    @Override
1599 1618
    public void addStatus(NomenclaturalStatus nomStatus) {
1600 1619
        this.status.add(nomStatus);
1601 1620
    }
1621
    @Override
1602 1622
    public NomenclaturalStatus addStatus(NomenclaturalStatusType statusType, Reference citation, String microCitation) {
1603 1623
        NomenclaturalStatus newStatus = NomenclaturalStatus.NewInstance(statusType, citation, microCitation);
1604 1624
        this.status.add(newStatus);
......
1613 1633
     * @param  nomStatus  the nomenclatural status of <i>this</i> taxon name which should be deleted
1614 1634
     * @see     		  #getStatus()
1615 1635
     */
1636
    @Override
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)