(no commit message)
authorm.geoffroy <m.geoffroy@localhost>
Tue, 1 Jul 2008 09:08:44 +0000 (09:08 +0000)
committerm.geoffroy <m.geoffroy@localhost>
Tue, 1 Jul 2008 09:08:44 +0000 (09:08 +0000)
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/BacterialName.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/BotanicalName.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/NonViralName.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TaxonNameBase.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/ZoologicalName.java

index 5bd302b78bc6733692d8714a3e0a3d5625b10d97..9c6c14af5c420ae72e691c684a1aff51cc27ab4d 100644 (file)
@@ -51,6 +51,8 @@ public class BacterialName extends NonViralName {
         * only containing its {@link common.Rank rank},
         * its {@link common.HomotypicalGroup homotypical group} and
         * the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
+        * The new bacterial taxon name instance will be also added to the set of
+        * bacterial taxon names belonging to this homotypical group.
         * 
         * @param       rank  the rank to be assigned to this bacterial taxon name
         * @param       homotypicalGroup  the homotypical group to which this bacterial taxon name belongs
@@ -83,12 +85,11 @@ public class BacterialName extends NonViralName {
 
        /** 
         * Creates a new bacterial taxon name instance
-        * only containing its {@link common.Rank rank} and
+        * only containing its {@link common.Rank rank},
         * its {@link common.HomotypicalGroup homotypical group} and 
         * the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
         * The new bacterial taxon name instance will be also added to the set of
-        * bacterial taxon names belonging to this homotypical group. If the homotypical 
-        * group does not exist a new instance will be created for it.
+        * bacterial taxon names belonging to this homotypical group.
         * 
         * @param  rank  the rank to be assigned to this bacterial taxon name
         * @param  homotypicalGroup  the homotypical group to which this bacterial taxon name belongs
index 1fde127a101398361c5fe9baf347e3891b8ab373..633aa00fb3d9bfea1e5d3a68cc106a6b51d53fd3 100644 (file)
@@ -35,7 +35,8 @@ import eu.etaxonomy.cdm.strategy.parser.INonViralNameParser;
 import eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl;
 
 /**
- * Taxon name class for plants
+ * The taxon name class for plants.
+ * 
  * @author m.doering
  * @version 1.0
  * @created 08-Nov-2007 13:06:15
@@ -79,25 +80,140 @@ public class BotanicalName extends NonViralName {
 
        static private INonViralNameParser nameParser = new NonViralNameParserImpl();
        
+       // ************* CONSTRUCTORS *************/    
+       //needed by hibernate
+       /** 
+        * Class constructor: creates a new botanical taxon name instance
+        * only containing the {@link eu.etaxonomy.cdm.strategy.cache.BotanicNameDefaultCacheStrategy default cache strategy}.
+        * 
+        * @see #BotanicalName(Rank, HomotypicalGroup)
+        * @see #BotanicalName(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
+        * @see eu.etaxonomy.cdm.strategy.cache.BotanicNameDefaultCacheStrategy
+        */
+       protected BotanicalName(){
+               super();
+               this.cacheStrategy = BotanicNameDefaultCacheStrategy.NewInstance();
+       }
+       /** 
+        * Class constructor: creates a new botanical taxon name instance
+        * only containing its {@link common.Rank rank},
+        * its {@link common.HomotypicalGroup homotypical group} and
+        * the {@link eu.etaxonomy.cdm.strategy.cache.BotanicNameDefaultCacheStrategy default cache strategy}.
+        * The new botanical taxon name instance will be also added to the set of
+        * botanical taxon names belonging to this homotypical group.
+        * 
+        * @param       rank  the rank to be assigned to this botanical taxon name
+        * @param       homotypicalGroup  the homotypical group to which this botanical taxon name belongs
+        * @see         #BotanicalName()
+        * @see         #BotanicalName(Rank, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
+        * @see         eu.etaxonomy.cdm.strategy.cache.BotanicNameDefaultCacheStrategy
+        */
+       protected BotanicalName(Rank rank, HomotypicalGroup homotypicalGroup) {
+               super(rank, homotypicalGroup);
+               this.cacheStrategy = BotanicNameDefaultCacheStrategy.NewInstance();
+       }
+       /** 
+        * Class constructor: creates a new botanical taxon name instance
+        * containing its {@link common.Rank rank},
+        * its {@link common.HomotypicalGroup homotypical group},
+        * its scientific name components, its {@link agent.TeamOrPersonBase author(team)},
+        * its {@link reference.INomenclaturalReference nomenclatural reference} and
+        * the {@link eu.etaxonomy.cdm.strategy.cache.BotanicNameDefaultCacheStrategy default cache strategy}.
+        * The new botanical taxon name instance will be also added to the set of
+        * botanical taxon names belonging to this homotypical group.
+        * 
+        * @param       rank  the rank to be assigned to this botanical taxon name
+        * @param       genusOrUninomial the string for this botanical taxon name
+        *                      if its rank is genus or higher or for the genus part
+        *                      if its rank is lower than genus
+        * @param       infraGenericEpithet  the string for the first epithet of
+        *                      this botanical taxon name if its rank is lower than genus
+        *                      and higher than species aggregate
+        * @param       specificEpithet  the string for the first epithet of
+        *                      this botanical taxon name if its rank is species aggregate or lower
+        * @param       infraSpecificEpithet  the string for the second epithet of
+        *                      this botanical taxon name if its rank is lower than species
+        * @param       combinationAuthorTeam  the author or the team who published this botanical taxon name
+        * @param       nomenclaturalReference  the nomenclatural reference where this botanical taxon name was published
+        * @param       nomenclMicroRef  the string with the details for precise location within the nomenclatural reference
+        * @param       homotypicalGroup  the homotypical group to which this botanical taxon name belongs
+        * @see         #BotanicalName()
+        * @see         #BotanicalName(Rank, HomotypicalGroup)
+        * @see         #NewInstance(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
+        * @see         eu.etaxonomy.cdm.strategy.cache.BotanicNameDefaultCacheStrategy
+        * @see         eu.etaxonomy.cdm.strategy.cache.INonViralNameCacheStrategy
+        * @see         eu.etaxonomy.cdm.strategy.cache.IIdentifiableEntityCacheStrategy
+        */
+       protected BotanicalName(Rank rank, String genusOrUninomial, String infraGenericEpithet, String specificEpithet, String infraSpecificEpithet, TeamOrPersonBase combinationAuthorTeam, INomenclaturalReference nomenclaturalReference, String nomenclMicroRef, HomotypicalGroup homotypicalGroup) {
+               super(rank, genusOrUninomial, infraGenericEpithet, specificEpithet, infraSpecificEpithet, combinationAuthorTeam, nomenclaturalReference, nomenclMicroRef, homotypicalGroup);
+               this.cacheStrategy = BotanicNameDefaultCacheStrategy.NewInstance();
+       }
+
        
-       /**
-        * @param rank
-        * @return
+       //********* METHODS **************************************/
+       
+       /** 
+        * Creates a new botanical taxon name instance
+        * only containing its {@link common.Rank rank} and
+        * the {@link eu.etaxonomy.cdm.strategy.cache.BotanicNameDefaultCacheStrategy default cache strategy}.
+        * 
+        * @param       rank    the rank to be assigned to this botanical taxon name
+        * @see                         #BotanicalName(Rank, HomotypicalGroup)
+        * @see                         #NewInstance(Rank, HomotypicalGroup)
+        * @see                         #NewInstance(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
+        * @see                         eu.etaxonomy.cdm.strategy.cache.BotanicNameDefaultCacheStrategy
         */
        public static BotanicalName NewInstance(Rank rank){
                return new BotanicalName(rank, null);
        }
-
-
-       /**
-        * @param rank
-        * @param homotypicalGroup
-        * @return
+       /** 
+        * Creates a new botanical taxon name instance
+        * only containing its {@link common.Rank rank},
+        * its {@link common.HomotypicalGroup homotypical group} and 
+        * the {@link eu.etaxonomy.cdm.strategy.cache.BotanicNameDefaultCacheStrategy default cache strategy}.
+        * The new botanical taxon name instance will be also added to the set of
+        * botanical taxon names belonging to this homotypical group.
+        * 
+        * @param  rank  the rank to be assigned to this botanical taxon name
+        * @param  homotypicalGroup  the homotypical group to which this botanical taxon name belongs
+        * @see    #NewInstance(Rank)
+        * @see    #NewInstance(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
+        * @see    #BotanicalName(Rank, HomotypicalGroup)
+        * @see    eu.etaxonomy.cdm.strategy.cache.BotanicNameDefaultCacheStrategy
         */
        public static BotanicalName NewInstance(Rank rank, HomotypicalGroup homotypicalGroup){
                return new BotanicalName(rank, homotypicalGroup);
        }
-       
+       /** 
+        * Creates a new botanical taxon name instance
+        * containing its {@link common.Rank rank},
+        * its {@link common.HomotypicalGroup homotypical group},
+        * its scientific name components, its {@link agent.TeamOrPersonBase author(team)},
+        * its {@link reference.INomenclaturalReference nomenclatural reference} and
+        * the {@link eu.etaxonomy.cdm.strategy.cache.BotanicNameDefaultCacheStrategy default cache strategy}.
+        * The new botanical taxon name instance will be also added to the set of
+        * botanical taxon names belonging to this homotypical group.
+        * 
+        * @param       rank  the rank to be assigned to this botanical taxon name
+        * @param       genusOrUninomial the string for this botanical taxon name
+        *                      if its rank is genus or higher or for the genus part
+        *                      if its rank is lower than genus
+        * @param       infraGenericEpithet  the string for the first epithet of
+        *                      this botanical taxon name if its rank is lower than genus
+        *                      and higher than species aggregate
+        * @param       specificEpithet  the string for the first epithet of
+        *                      this botanical taxon name if its rank is species aggregate or lower
+        * @param       infraSpecificEpithet  the string for the second epithet of
+        *                      this botanical taxon name if its rank is lower than species
+        * @param       combinationAuthorTeam  the author or the team who published this botanical taxon name
+        * @param       nomenclaturalReference  the nomenclatural reference where this botanical taxon name was published
+        * @param       nomenclMicroRef  the string with the details for precise location within the nomenclatural reference
+        * @param       homotypicalGroup  the homotypical group to which this botanical taxon name belongs
+        * @see         #NewInstance(Rank)
+        * @see         #NewInstance(Rank, HomotypicalGroup)
+        * @see         #ZoologicalName(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
+        * @see         eu.etaxonomy.cdm.strategy.cache.BotanicNameDefaultCacheStrategy
+        */
        public static  BotanicalName NewInstance(Rank rank, String genusOrUninomial, String infraGenericEpithet, String specificEpithet, String infraSpecificEpithet, TeamOrPersonBase combinationAuthorTeam, INomenclaturalReference nomenclaturalReference, String nomenclMicroRef, HomotypicalGroup homotypicalGroup) {
                return new BotanicalName(rank, genusOrUninomial, infraGenericEpithet, specificEpithet, infraSpecificEpithet, combinationAuthorTeam, nomenclaturalReference, nomenclMicroRef, homotypicalGroup);
        }
@@ -144,20 +260,6 @@ public class BotanicalName extends NonViralName {
                return (BotanicalName)nameParser.parseFullReference(fullNameAndReferenceString, NomenclaturalCode.ICBN(), rank);
        }
        
-       //needed by hibernate
-       protected BotanicalName(){
-               super();
-               this.cacheStrategy = BotanicNameDefaultCacheStrategy.NewInstance();
-       }
-       protected BotanicalName(Rank rank, HomotypicalGroup homotypicalGroup) {
-               super(rank, homotypicalGroup);
-               this.cacheStrategy = BotanicNameDefaultCacheStrategy.NewInstance();
-       }
-       protected BotanicalName(Rank rank, String genusOrUninomial, String infraGenericEpithet, String specificEpithet, String infraSpecificEpithet, TeamOrPersonBase combinationAuthorTeam, INomenclaturalReference nomenclaturalReference, String nomenclMicroRef, HomotypicalGroup homotypicalGroup) {
-               super(rank, genusOrUninomial, infraGenericEpithet, specificEpithet, infraSpecificEpithet, combinationAuthorTeam, nomenclaturalReference, nomenclMicroRef, homotypicalGroup);
-               this.cacheStrategy = BotanicNameDefaultCacheStrategy.NewInstance();
-       }
-
        
        @OneToMany
        @Cascade({CascadeType.SAVE_UPDATE, CascadeType.DELETE_ORPHAN})
@@ -193,6 +295,8 @@ public class BotanicalName extends NonViralName {
                }
        }
 
+       //if set: this name is a hybrid formula (a hybrid that does not have an own name) and no other hybrid flags may be set. A
+       //hybrid name  may not have either an authorteam nor other name components.
        public boolean isHybridFormula(){
                return this.isHybridFormula;
        }
@@ -254,6 +358,16 @@ public class BotanicalName extends NonViralName {
        }
        
        
+       /**
+        * Returns the {@link NomenclaturalCode nomenclatural code} that governs
+        * the construction of this botanical taxon name, that is the
+        * International Code of Botanical Nomenclature. This method overrides
+        * the getNomeclaturalCode method from {@link TaxonNameBase#getNomeclaturalCode() TaxonNameBase}.
+        *
+        * @return  the nomenclatural code for plants
+        * @see         NonViralName#isCodeCompliant()
+        * @see         TaxonNameBase#getHasProblem()
+        */
        @Transient
        @Override
        public NomenclaturalCode getNomenclaturalCode(){
index 00edb9d7a53b8b6bb097673696f3af15f8a779b3..0851595df1775f2b10ea1460c99f429eed6d5a69 100644 (file)
@@ -133,6 +133,8 @@ public class NonViralName<T extends NonViralName> extends TaxonNameBase<NonViral
         * only containing its {@link common.Rank rank},
         * its {@link common.HomotypicalGroup homotypical group} and
         * the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
+        * The new non viral taxon name instance will be also added to the set of
+        * non viral taxon names belonging to this homotypical group.
         * 
         * @param       rank  the rank to be assigned to this non viral taxon name
         * @param       homotypicalGroup  the homotypical group to which this non viral taxon name belongs
@@ -154,6 +156,8 @@ public class NonViralName<T extends NonViralName> extends TaxonNameBase<NonViral
         * its scientific name components, its {@link agent.TeamOrPersonBase author(team)},
         * its {@link reference.INomenclaturalReference nomenclatural reference} and
         * the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
+        * The new non viral taxon name instance will be also added to the set of
+        * non viral taxon names belonging to this homotypical group.
         * 
         * @param       rank  the rank to be assigned to this non viral taxon name
         * @param       genusOrUninomial the string for this taxon name
@@ -210,12 +214,11 @@ public class NonViralName<T extends NonViralName> extends TaxonNameBase<NonViral
 
        /** 
         * Creates a new non viral taxon name instance
-        * only containing its {@link common.Rank rank} and
+        * only containing its {@link common.Rank rank},
         * its {@link common.HomotypicalGroup homotypical group} and 
         * the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
         * The new non viral taxon name instance will be also added to the set of
-        * non viral taxon names belonging to this homotypical group. If the homotypical 
-        * group does not exist a new instance will be created for it.
+        * non viral taxon names belonging to this homotypical group.
         * 
         * @param  rank  the rank to be assigned to this non viral taxon name
         * @param  homotypicalGroup  the homotypical group to which this non viral taxon name belongs
index 0ea8e3426fcdc6d6f923a1283790db707ab002f5..38257d6a9fc74eb607c2dfdd2b526b13cdddf4a1 100644 (file)
@@ -160,8 +160,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase, S extends INameCach
         * Class constructor: creates a new taxon name
         * only containing its {@link common.HomotypicalGroup homotypical group}.
         * The new taxon name will be also added to the set of taxon names
-        * belonging to this homotypical group. If the homotypical group 
-        * does not exist a new instance will be created for it.
+        * belonging to this homotypical group.
         * 
         * @param  homotypicalGroup  the homotypical group to which this taxon name belongs
         * @see    #TaxonNameBase()
@@ -175,6 +174,8 @@ public abstract class TaxonNameBase<T extends TaxonNameBase, S extends INameCach
         * Class constructor: creates a new taxon name
         * only containing its {@link common.Rank rank} and
         * its {@link common.HomotypicalGroup homotypical group}.
+        * The new taxon name will be also added to the set of taxon names
+        * belonging to this homotypical group.
         * 
         * @param  rank  the rank to be assigned to this taxon name
         * @param  homotypicalGroup  the homotypical group to which this taxon name belongs
index d1a902fcf3f8640949c6e600d3ebaeb7f6155950..434c4f6c2f8a20416bae5856549afcaee0c0da76 100644 (file)
@@ -78,9 +78,11 @@ public class ZoologicalName extends NonViralName {
         * only containing its {@link common.Rank rank},
         * its {@link common.HomotypicalGroup homotypical group} and
         * the {@link eu.etaxonomy.cdm.strategy.cache.ZooNameDefaultCacheStrategy default cache strategy}.
+        * The new zoological taxon name instance will be also added to the set of
+        * zoological taxon names belonging to this homotypical group.
         * 
-        * @param       rank  the rank to be assigned to this non viral taxon name
-        * @param       homotypicalGroup  the homotypical group to which this non viral taxon name belongs
+        * @param       rank  the rank to be assigned to this zoological taxon name
+        * @param       homotypicalGroup  the homotypical group to which this zoological taxon name belongs
         * @see         #ZoologicalName()
         * @see         #ZoologicalName(Rank, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
         * @see         eu.etaxonomy.cdm.strategy.cache.ZooNameDefaultCacheStrategy
@@ -97,6 +99,8 @@ public class ZoologicalName extends NonViralName {
         * its scientific name components, its {@link agent.TeamOrPersonBase author(team)},
         * its {@link reference.INomenclaturalReference nomenclatural reference} and
         * the {@link eu.etaxonomy.cdm.strategy.cache.ZooNameDefaultCacheStrategy default cache strategy}.
+        * The new zoological taxon name instance will be also added to the set of
+        * zoological taxon names belonging to this homotypical group.
         * 
         * @param       rank  the rank to be assigned to this zoological taxon name
         * @param       genusOrUninomial the string for this zoological taxon name
@@ -137,7 +141,7 @@ public class ZoologicalName extends NonViralName {
         * @see                         #ZoologicalName(Rank, HomotypicalGroup)
         * @see                         #NewInstance(Rank, HomotypicalGroup)
         * @see                         #NewInstance(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
-        * @see                         eu.etaxonomy.cdm.strategy.cache.BookDefaultCacheStrategy
+        * @see                         eu.etaxonomy.cdm.strategy.cache.ZooNameDefaultCacheStrategy
         */
        public static ZoologicalName NewInstance(Rank rank){
                return new ZoologicalName(rank, null);
@@ -145,12 +149,11 @@ public class ZoologicalName extends NonViralName {
 
        /** 
         * Creates a new zoological taxon name instance
-        * only containing its {@link common.Rank rank} and
+        * only containing its {@link common.Rank rank},
         * its {@link common.HomotypicalGroup homotypical group} and 
         * the {@link eu.etaxonomy.cdm.strategy.cache.ZooNameDefaultCacheStrategy default cache strategy}.
         * The new zoological taxon name instance will be also added to the set of
-        * zoological taxon names belonging to this homotypical group. If the homotypical 
-        * group does not exist a new instance will be created for it.
+        * zoological taxon names belonging to this homotypical group.
         * 
         * @param  rank  the rank to be assigned to this zoological taxon name
         * @param  homotypicalGroup  the homotypical group to which this zoological taxon name belongs
@@ -169,6 +172,8 @@ public class ZoologicalName extends NonViralName {
         * its scientific name components, its {@link agent.TeamOrPersonBase author(team)},
         * its {@link reference.INomenclaturalReference nomenclatural reference} and
         * the {@link eu.etaxonomy.cdm.strategy.cache.ZooNameDefaultCacheStrategy default cache strategy}.
+        * The new zoological taxon name instance will be also added to the set of
+        * zoological taxon names belonging to this homotypical group.
         * 
         * @param       rank  the rank to be assigned to this zoological taxon name
         * @param       genusOrUninomial the string for this zoological taxon name