Project

General

Profile

Download (3.92 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 secundum reference as used in a misapplied name (for TaxonRelationship)
93
//     */
94
//    sensuReference,
95
//    /**
96
//     * a secundum micro reference as used in a misapplied name (for TaxonRelationship)
97
//     */
98
//    sensuMicroReference,
99
    /**
100
     * a reference as used in a relation (e.g. TaxonRelationship reference)
101
     */
102
    relSecReference,
103
    /**
104
     * a micro reference as used in a relation (e.g. TaxonRelationship micro reference)
105
     */
106
    relSecMicroReference,
107
    /**
108
     * Any type of label
109
     */
110
    label,
111
    specimenOrObservation,
112
    typeDesignation,
113
    /**
114
     * Any symbol representing information, used e.g. for representing relationships
115
     * like taxon relationships.
116
     */
117
    symbol,
118
	;
119

    
120

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

    
143
	public boolean isNomStatus(){
144
		return this == nomStatus;
145
	}
146
	/**
147
	 * @return <code>true</code> if type is separator or postSeparator
148
	 */
149
	public boolean isSeparator(){
150
		return this == separator || this == postSeparator;
151
	}
152
	public boolean isHybridSign(){
153
		return this == hybridSign;
154
	}
155

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

    
166
}
(2-2/5)