Project

General

Profile

Download (39.2 KB) Statistics
| Branch: | Tag: | Revision:
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.common.IdentifiableEntity;
20
import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
21
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
22
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
23
import eu.etaxonomy.cdm.model.reference.Reference;
24
import eu.etaxonomy.cdm.model.taxon.Synonym;
25
import eu.etaxonomy.cdm.model.taxon.Taxon;
26
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
27
import eu.etaxonomy.cdm.model.taxon.TaxonComparator;
28
import eu.etaxonomy.cdm.strategy.cache.TaggedText;
29
import eu.etaxonomy.cdm.strategy.match.IMatchable;
30

    
31
/**
32
 *
33
 * The upmost interface for taxon names.
34
 * <P>
35
 * This class corresponds partially to: <ul>
36
 * <li> TaxonName according to the TDWG ontology
37
 * <li> ScientificName and CanonicalName according to the TCS
38
 * <li> ScientificName according to the ABCD schema
39
 * </ul>
40
 *
41
 * ITaxonNameBase and it's extensions should only be used for type safety
42
 * of {@link TaxonName} instances. It should not be used to interface
43
 * instances of any other class
44
 *
45
 * @author a.mueller
46
 * @date 21.01.2017
47
 *
48
 */
49
public interface ITaxonNameBase
50
        extends IIdentifiableEntity, IParsable, IRelated, IMatchable, Cloneable{
51

    
52

    
53
    public NomenclaturalCode getNameType();
54
    public void setNameType(NomenclaturalCode nameType);
55

    
56
    public Object clone();
57

    
58
    public String generateFullTitle();
59

    
60
    @Transient
61
    public String getFullTitleCache();
62

    
63
    @Transient
64
    public NomenclaturalCode getNomenclaturalCode();
65

    
66
    public List<TaggedText> getTaggedName();
67

    
68
    public void setFullTitleCache(String fullTitleCache);
69

    
70
    public void setFullTitleCache(String fullTitleCache, boolean protectCache);
71

    
72
    public boolean isProtectedFullTitleCache();
73

    
74
    void setProtectedFullTitleCache(boolean protectedFullTitleCache);
75

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

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

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

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

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

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

    
169
    public void removeRelationToTaxonName(TaxonName toTaxonName);
170

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

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

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

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

    
211
    public NomenclaturalStatus addStatus(NomenclaturalStatusType statusType, Reference citation, String microCitation);
212

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
531
    public HomotypicalGroup getHomotypicalGroup();
532

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

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

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

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

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

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

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

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

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

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

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

    
651
    public void mergeHomotypicGroups(TaxonName name);
652

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

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

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

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

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

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

    
719

    
720
    /**
721
     * Returns the boolean value indicating whether the taxonomic {@link Rank rank} of <i>this</i>
722
     * taxon name is the genus rank or higher (<code>true</code>) or not (<code>false</code>).
723
     * Non viral names with
724
     * genus rank or higher are monomials. Returns false if rank is null.<BR>
725
     * This is a shortcut for {@link #isGenus()} || {@link #isSupraGeneric()}
726
     *
727
     * @see  #isGenus()
728
     * @see  #isSupraGeneric()
729
     * @see  #isInfraGeneric()
730
     * @see  #isSpecies()
731
     * @see  #isInfraSpecific()
732
     */
733
    boolean isGenusOrSupraGeneric();
734

    
735
    /**
736
     * Returns the boolean value indicating whether the taxonomic {@link Rank rank} of <i>this</i>
737
     * taxon name is higher than the species rank and lower than the
738
     * genus rank (true) or not (false). Infrageneric non viral names are
739
     * binomials. Returns false if rank is null.
740
     *
741
     * @see  #isSupraGeneric()
742
     * @see  #isGenus()
743
     * @see  #isSpecies()
744
     * @see  #isInfraSpecific()
745
     */
746
    public boolean isInfraGeneric();
747

    
748
    /**
749
     * Returns the boolean value indicating whether the taxonomic {@link Rank rank} of <i>this</i>
750
     * taxon name is higher than the species rank (true) or not (false).
751
     * Returns false if rank is null.
752
     *
753
     * @see  #isGenus()
754
     * @see  #isInfraGeneric()
755
     * @see  #isSpecies()
756
     * @see  #isInfraSpecific()
757
     */
758
    public boolean isSupraSpecific();
759

    
760
    /**
761
     * Returns the boolean value indicating whether the taxonomic {@link Rank rank} of <i>this</i>
762
     * taxon name is the species rank (true) or not (false). Non viral names
763
     * with species rank are binomials.
764
     * Returns false if rank is null.
765
     *
766
     * @see  #isSupraGeneric()
767
     * @see  #isGenus()
768
     * @see  #isInfraGeneric()
769
     * @see  #isInfraSpecific()
770
     */
771
    public boolean isSpecies();
772

    
773
    /**
774
     * Returns the boolean value indicating whether the taxonomic {@link Rank rank} of <i>this</i>
775
     * taxon name is lower than the species rank (true) or not (false).
776
     * Infraspecific non viral names are trinomials.
777
     * Returns false if rank is null.
778
     *
779
     * @see  #isSupraGeneric()
780
     * @see  #isGenus()
781
     * @see  #isInfraGeneric()
782
     * @see  #isSpecies()
783
     */
784
    public boolean isInfraSpecific();
785

    
786
    /**
787
     * Returns true if this name's rank indicates a rank that aggregates species like species
788
     * aggregates or species groups, false otherwise. This methods currently returns false
789
     * for all user defined ranks.
790
     *
791
     *@see Rank#isSpeciesAggregate()
792
     *
793
     * @return
794
     */
795
    public boolean isSpeciesAggregate();
796

    
797
    /**
798
     * Creates a basionym relationship between this name and
799
     *  each name in its homotypic group.
800
     *
801
     * @param basionymName
802
     */
803
    public void setAsGroupsBasionym();
804

    
805
    /**
806
     * Removes basionym relationship between this name and
807
     *  each name in its homotypic group.
808
     *
809
     * @param basionymName
810
     */
811
    public void removeAsGroupsBasionym();
812

    
813
    /**
814
     * This method compares 2 taxon names on it's name titles and caches.
815
     * Maybe in future more parts will be added.
816
     * It is not fully clear/defined how this method relates to
817
     * explicit comparators like {@link TaxonNameComparator}.
818
     * Historically it was a compareTo method in {@link IdentifiableEntity}
819
     * but did not fulfill the {@link Comparable} contract.
820
     * <BR><BR>
821
     * {@link  https://dev.e-taxonomy.eu/redmine/issues/922}<BR>
822
     * {@link https://dev.e-taxonomy.eu/redmine/issues/6311}
823
     *
824
     * @see TaxonName#compareToName(TaxonName)
825
     * @see TaxonNameComparator
826
     * @see TaxonComparator
827
     * @param otherTaxon
828
     * @return the compareTo result similar to {@link Comparable#compareTo(Object)}
829
     * @throws NullPointerException if otherTaxon is <code>null</code>
830
     */
831
    public int compareToName(TaxonName otherName);
832

    
833
    /**
834
     * This method returns als {@link Registration registrations} for the given name.
835
     * @return
836
     */
837
    public Set<Registration> getRegistrations();
838

    
839

    
840
    /**
841
     * Returns <code>true</code> if this name is of type {@link NomenclaturalCode#ICZN} or
842
     * any sub type and is supposed to be handled via {@link IZoologicalName}
843
     */
844
    public boolean isZoological();
845

    
846
    /**
847
     * Returns <code>true</code> if this name is of type {@link NomenclaturalCode#NonViral} or
848
     * any sub type and is supposed to be handled via {@link INonViralName}
849
     */
850
    public boolean isNonViral();
851

    
852
    /**
853
     * Returns <code>true</code> if this name is of type {@link NomenclaturalCode#ICNAFP} or
854
     * any sub type and is supposed to be handled via {@link IBotanicalName}
855
     */
856
    public boolean isBotanical();
857

    
858
    /**
859
     * Returns <code>true</code> if this name is of type {@link NomenclaturalCode#ICNCP} or
860
     * any sub type and is supposed to be handled via {@link ICultivarPlantName}
861
     */
862
    boolean isCultivar();
863

    
864
    /**
865
     * Returns <code>true</code> if this name is of type {@link NomenclaturalCode#ICNB} or
866
     * any sub type and is supposed to be handled via {@link IBacterialName}
867
     */
868
    boolean isBacterial();
869

    
870
    /**
871
     * Returns <code>true</code> if this name is of type {@link NomenclaturalCode#ICVCN} or
872
     * any sub type and is supposed to be handled via {@link IViralName}
873
     */
874
    boolean isViral();
875

    
876
}
(15-15/42)