Revision d7919b1c
Added by Andreas Müller about 7 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TaxonNameBase.java | ||
---|---|---|
166 | 166 |
public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INameCacheStrategy> |
167 | 167 |
extends IdentifiableEntity<S> |
168 | 168 |
implements ITaxonNameBase, INonViralName, IViralName, IBacterialName, IZoologicalName, |
169 |
ICultivarPlantName, |
|
169 |
IBotanicalName, ICultivarPlantName,
|
|
170 | 170 |
IParsable, IRelated, IMatchable, Cloneable { |
171 | 171 |
|
172 | 172 |
private static final long serialVersionUID = -791164269603409712L; |
... | ... | |
301 | 301 |
@IndexedEmbedded |
302 | 302 |
private Reference nomenclaturalReference; |
303 | 303 |
|
304 |
//****** NonViralName attributes ***************************************/ |
|
304 |
//****** Non-ViralName attributes ***************************************/
|
|
305 | 305 |
|
306 | 306 |
@XmlElement(name = "NameCache") |
307 | 307 |
@Fields({ |
... | ... | |
2727 | 2727 |
* @see #addNameRelationship(NameRelationship) |
2728 | 2728 |
*/ |
2729 | 2729 |
@Override |
2730 |
public HybridRelationship addHybridParent(NonViralName parentName, HybridRelationshipType type, String ruleConsidered){ |
|
2730 |
public HybridRelationship addHybridParent(INonViralName parentName, HybridRelationshipType type, String ruleConsidered){
|
|
2731 | 2731 |
return new HybridRelationship(this, parentName, type, ruleConsidered); |
2732 | 2732 |
} |
2733 | 2733 |
|
... | ... | |
2749 | 2749 |
* @see #addNameRelationship(NameRelationship) |
2750 | 2750 |
*/ |
2751 | 2751 |
@Override |
2752 |
public HybridRelationship addHybridChild(NonViralName childName, HybridRelationshipType type, String ruleConsidered){ |
|
2752 |
public HybridRelationship addHybridChild(INonViralName childName, HybridRelationshipType type, String ruleConsidered){
|
|
2753 | 2753 |
return new HybridRelationship(childName, this, type, ruleConsidered); |
2754 | 2754 |
} |
2755 | 2755 |
|
2756 | 2756 |
@Override |
2757 |
public void removeHybridChild(NonViralName child) { |
|
2757 |
public void removeHybridChild(INonViralName child) {
|
|
2758 | 2758 |
Set<HybridRelationship> hybridRelationships = new HashSet<HybridRelationship>(); |
2759 | 2759 |
hybridRelationships.addAll(this.getHybridChildRelations()); |
2760 | 2760 |
hybridRelationships.addAll(this.getHybridParentRelations()); |
... | ... | |
2767 | 2767 |
} |
2768 | 2768 |
|
2769 | 2769 |
@Override |
2770 |
public void removeHybridParent(NonViralName parent) { |
|
2770 |
public void removeHybridParent(INonViralName parent) {
|
|
2771 | 2771 |
Set<HybridRelationship> hybridRelationships = new HashSet<HybridRelationship>(); |
2772 | 2772 |
hybridRelationships.addAll(this.getHybridChildRelations()); |
2773 | 2773 |
hybridRelationships.addAll(this.getHybridParentRelations()); |
... | ... | |
3364 | 3364 |
result = (TaxonNameBase)super.clone(); |
3365 | 3365 |
|
3366 | 3366 |
//taxonBases -> empty |
3367 |
result.taxonBases = new HashSet<TaxonBase>();
|
|
3367 |
result.taxonBases = new HashSet<>(); |
|
3368 | 3368 |
|
3369 | 3369 |
//empty caches |
3370 | 3370 |
if (! protectedFullTitleCache){ |
... | ... | |
3372 | 3372 |
} |
3373 | 3373 |
|
3374 | 3374 |
//descriptions |
3375 |
result.descriptions = new HashSet<TaxonNameDescription>();
|
|
3375 |
result.descriptions = new HashSet<>(); |
|
3376 | 3376 |
for (TaxonNameDescription taxonNameDescription : getDescriptions()){ |
3377 | 3377 |
TaxonNameDescription newDescription = (TaxonNameDescription)taxonNameDescription.clone(); |
3378 | 3378 |
result.descriptions.add(newDescription); |
3379 | 3379 |
} |
3380 | 3380 |
|
3381 | 3381 |
//status |
3382 |
result.status = new HashSet<NomenclaturalStatus>();
|
|
3382 |
result.status = new HashSet<>(); |
|
3383 | 3383 |
for (NomenclaturalStatus nomenclaturalStatus : getStatus()){ |
3384 | 3384 |
NomenclaturalStatus newStatus = (NomenclaturalStatus)nomenclaturalStatus.clone(); |
3385 | 3385 |
result.status.add(newStatus); |
... | ... | |
3387 | 3387 |
|
3388 | 3388 |
|
3389 | 3389 |
//To Relations |
3390 |
result.relationsToThisName = new HashSet<NameRelationship>();
|
|
3390 |
result.relationsToThisName = new HashSet<>(); |
|
3391 | 3391 |
for (NameRelationship toRelationship : getRelationsToThisName()){ |
3392 | 3392 |
NameRelationship newRelationship = (NameRelationship)toRelationship.clone(); |
3393 | 3393 |
newRelationship.setRelatedTo(result); |
... | ... | |
3395 | 3395 |
} |
3396 | 3396 |
|
3397 | 3397 |
//From Relations |
3398 |
result.relationsFromThisName = new HashSet<NameRelationship>();
|
|
3398 |
result.relationsFromThisName = new HashSet<>(); |
|
3399 | 3399 |
for (NameRelationship fromRelationship : getRelationsFromThisName()){ |
3400 | 3400 |
NameRelationship newRelationship = (NameRelationship)fromRelationship.clone(); |
3401 | 3401 |
newRelationship.setRelatedFrom(result); |
... | ... | |
3403 | 3403 |
} |
3404 | 3404 |
|
3405 | 3405 |
//type designations |
3406 |
result.typeDesignations = new HashSet<TypeDesignationBase>();
|
|
3406 |
result.typeDesignations = new HashSet<>(); |
|
3407 | 3407 |
for (TypeDesignationBase<?> typeDesignation : getTypeDesignations()){ |
3408 | 3408 |
TypeDesignationBase<?> newDesignation = (TypeDesignationBase<?>)typeDesignation.clone(); |
3409 | 3409 |
result.typeDesignations.add(newDesignation); |
Also available in: Unified diff
ref #6362, ref #6365 remove occurrence of NonViralName, BotanicalName, ZoologicalName and others