Project

General

Profile

Download (4.07 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.strategy.cache;
11

    
12
import eu.etaxonomy.cdm.model.name.TaxonName;
13

    
14
/**
15
 * Tag types for atomised taxon name strings and atomised reference citation strings.
16
 * Used by {@link TaggedText}.
17
 *
18
 * @author a.kohlbecker
19
 * @since 13.12.2007
20
 *
21
 */
22
public enum TagEnum {
23

    
24
	/**
25
	 *  A taxon name including genus name, epithet etc.
26
	 */
27
	name,
28
	/**
29
	 *  A name rank abbreviation, e.g. subsp.
30
	 */
31
	rank,
32
	/**
33
     * Cultivar part of cultivar taxon name ruled by the ICNCP (should not be in italics if name is in italics and vice versa)
34
     */
35
    cultivar,
36
	/**
37
	 * Non-atomised addition to a taxon name or a taxon not ruled by a nomenclatural code
38
	 */
39
	appendedPhrase,
40
	/**
41
	 * The authors of a reference, also used in taxon names
42
	 */
43
	authors,
44
	/**
45
	 * a reference
46
	 */
47
	reference,
48
	/**
49
	 * Volume, page number etc. of a reference
50
	 */
51
	microreference,
52
	/**
53
	 * Publication year of a reference
54
	 */
55
	year,
56
	/**
57
	 *  A full taxon name including all name information and nomenclatural
58
	 *  reference information
59
	 */
60
	fullName,
61
	/**
62
	 *  The nomenclatural status of a name
63
	 */
64
	nomStatus,
65
	/**
66
	 *  A separator to separate two tags () .
67
	 *  A separator should include all needed whitespaces. So adding of whitespace
68
	 *  is not needed if a separator is given.
69
	 */
70
	separator,
71
	/**
72
     *  A separator that needs to be added to the previous text if and only if
73
     *  the previous tag is used (not filtered) and if it is not the last tag
74
     *  in the list.<BR>
75
     *  A post-separator should include all needed whitespaces. So adding of whitespace
76
     *  is not needed if a post-separator is given.
77
     */
78
    postSeparator,
79
	/**
80
	 *  The hybrid sign.
81
	 */
82
	hybridSign,
83
    /**
84
     * a secundum reference (for TaxonBase)
85
     */
86
    secReference,
87
    /**
88
     * a secundum micro reference (for TaxonBase)
89
     */
90
    secMicroReference,
91
    /**
92
     * a separator for name in source of secundum reference(for TaxonBase)
93
     */
94
    secNameInSourceSeparator,
95
    
96
//    /**
97
//     * a secundum reference as used in a misapplied name (for TaxonRelationship)
98
//     */
99
//    sensuReference,
100
//    /**
101
//     * a secundum micro reference as used in a misapplied name (for TaxonRelationship)
102
//     */
103
//    sensuMicroReference,
104
    /**
105
     * a reference as used in a relation (e.g. TaxonRelationship reference)
106
     */
107
    relSecReference,
108
    /**
109
     * a micro reference as used in a relation (e.g. TaxonRelationship micro reference)
110
     */
111
    relSecMicroReference,
112
    /**
113
     * Any type of label
114
     */
115
    label,
116
    specimenOrObservation,
117
    typeDesignation,
118
    /**
119
     * Any symbol representing information, used e.g. for representing relationships
120
     * like taxon relationships.
121
     */
122
    symbol,
123
	;
124

    
125

    
126
	public boolean isName(){
127
		return this == name;
128
	}
129
	public boolean isRank(){
130
		return this == rank;
131
	}
132
	public boolean isAuthors(){
133
		return this == authors;
134
	}
135
	public boolean isAppendedPhrase(){
136
		return this == appendedPhrase;
137
	}
138
	public boolean isReference(){
139
		return this == reference;
140
	}
141
	public boolean isYear(){
142
		return this == year;
143
	}
144
	public boolean isFullName(){
145
		return this == fullName;
146
	}
147

    
148
	public boolean isNomStatus(){
149
		return this == nomStatus;
150
	}
151
	/**
152
	 * @return <code>true</code> if type is separator or postSeparator
153
	 */
154
	public boolean isSeparator(){
155
		return this == separator || this == postSeparator || this == secNameInSourceSeparator;
156
	}
157
	public boolean isHybridSign(){
158
		return this == hybridSign;
159
	}
160

    
161
	/**
162
	 * @return <code>true</code> if the tag is usually used in the pure name part
163
	 * of a {@link TaxonName}. This does not include author information. It is still
164
	 * unclear if {@link #isAppendedPhrase()} should be part. Currently it is.
165
	 * {@link #isSeparator()} is also unclear, currently it is not.
166
	 */
167
	public boolean isNameCachePart() {
168
        return isName()||isRank()||isHybridSign()||isAppendedPhrase();
169
    }
170

    
171
}
(2-2/5)