Project

General

Profile

Download (3.72 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
4
* http://www.e-taxonomy.eu
5
* 
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

    
10
package eu.etaxonomy.cdm.model.name;
11

    
12

    
13
import org.apache.log4j.Logger;
14

    
15
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
16
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
17
import eu.etaxonomy.cdm.strategy.cache.ZooNameDefaultCacheStrategy;
18
import eu.etaxonomy.cdm.strategy.parser.INonViralNameParser;
19
import eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl;
20

    
21

    
22
import javax.persistence.*;
23

    
24
/**
25
 * Taxon name class for animals
26
 * @author m.doering
27
 * @version 1.0
28
 * @created 08-Nov-2007 13:07:03
29
 */
30
@Entity
31
public class ZoologicalName extends NonViralName {
32
	static Logger logger = Logger.getLogger(ZoologicalName.class);
33

    
34
	//Name of the breed of an animal
35
	private String breed;
36
	private Integer publicationYear;
37
	private Integer originalPublicationYear;
38

    
39
	static private INonViralNameParser nameParser = new NonViralNameParserImpl();
40

    
41
	
42
	public static ZoologicalName NewInstance(Rank rank){
43
		return new ZoologicalName(rank, null);
44
	}
45

    
46
	public static ZoologicalName NewInstance(Rank rank, HomotypicalGroup homotypicalGroup){
47
		return new ZoologicalName(rank, homotypicalGroup);
48
	}
49
	public static ZoologicalName NewInstance(Rank rank, String genusOrUninomial, String specificEpithet, String infraSpecificEpithet, TeamOrPersonBase combinationAuthorTeam, INomenclaturalReference nomenclaturalReference, String nomenclMicroRef, HomotypicalGroup homotypicalGroup) {
50
		return new ZoologicalName(rank, genusOrUninomial, specificEpithet, infraSpecificEpithet, combinationAuthorTeam, nomenclaturalReference, nomenclMicroRef, homotypicalGroup);
51
	}	
52
	
53
	
54
	/**
55
	 * Returns a parsed Name
56
	 * @param fullName
57
	 * @return
58
	 */
59
	public static ZoologicalName PARSED_NAME(String fullNameString){
60
		return PARSED_NAME(fullNameString, Rank.GENUS());
61
	}
62
	
63
	/**
64
	 * Returns a parsed Name
65
	 * @param fullName
66
	 * @return
67
	 */
68
	public static ZoologicalName PARSED_NAME(String fullNameString, Rank rank){
69
		if (nameParser == null){
70
			nameParser  = new NonViralNameParserImpl();
71
		}
72
		return (ZoologicalName)nameParser.parseFullName(fullNameString, NomenclaturalCode.ICZN(), rank);
73
	}
74
	
75
	protected ZoologicalName() {
76
		this.cacheStrategy = ZooNameDefaultCacheStrategy.NewInstance();
77
	}
78
	
79
	protected ZoologicalName(Rank rank, HomotypicalGroup homotypicalGroup) {
80
		super(rank, homotypicalGroup);
81
		this.cacheStrategy = ZooNameDefaultCacheStrategy.NewInstance();
82
	}
83

    
84
	protected ZoologicalName (Rank rank, String genusOrUninomial, String specificEpithet, String infraSpecificEpithet, TeamOrPersonBase combinationAuthorTeam, INomenclaturalReference nomenclaturalReference, String nomenclMicroRef, HomotypicalGroup homotypicalGroup) {
85
		super(rank, genusOrUninomial, specificEpithet, infraSpecificEpithet, combinationAuthorTeam, nomenclaturalReference, nomenclMicroRef, homotypicalGroup);
86
		this.cacheStrategy = ZooNameDefaultCacheStrategy.NewInstance();
87
	}
88
	
89
	
90
	@Transient
91
	@Override
92
	public NomenclaturalCode getNomeclaturalCode(){
93
		return NomenclaturalCode.ICZN();
94
	}
95
	
96
/* ***************** GETTER / SETTER ***************************/
97
	
98
	public String getBreed(){
99
		return this.breed;
100
	}
101
	public void setBreed(String breed){
102
		this.breed = breed;
103
	}
104

    
105
	public Integer getPublicationYear() {
106
		return publicationYear;
107
	}
108
	public void setPublicationYear(Integer publicationYear) {
109
		this.publicationYear = publicationYear;
110
	}
111

    
112
	public Integer getOriginalPublicationYear() {
113
		return originalPublicationYear;
114
	}
115
	public void setOriginalPublicationYear(Integer originalPublicationYear) {
116
		this.originalPublicationYear = originalPublicationYear;
117
	}
118
}
(19-19/20)