Project

General

Profile

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

    
116

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

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

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

    
162
}
(2-2/5)