1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package de.fu_berlin.ties.context;
23
24 import org.apache.commons.lang.builder.ToStringBuilder;
25
26 /***
27 * Type-safe enumeration of the types of features used by the default
28 * representation.
29 *
30 * @author Christian Siefkes
31 * @version $Revision: 1.4 $, $Date: 2006/10/21 16:04:03 $, $Author: siefkes $
32 */
33 public final class FeatureType {
34
35 /***
36 * Constant for features representing attribute values.
37 */
38 public static final FeatureType ATTRIBUTE = new FeatureType("@");
39
40 /***
41 * Constant for features representing calculated values.
42 */
43 public static final FeatureType CALCULATED = new FeatureType("$");
44
45 /***
46 * Constant for features representing an element itself (marker is empty
47 * just as for text).
48 */
49 public static final FeatureType ELEMENT = new FeatureType("");
50
51 /***
52 * Constant for features marking a special position or situation.
53 */
54 public static final FeatureType MARKER = new FeatureType("---");
55
56 /***
57 * Constant for features representing textual content (marker is empty just
58 * as for elements).
59 */
60 public static final FeatureType TEXT = new FeatureType("");
61
62 /***
63 * The mark used to introduce features of this type.
64 */
65 private final String mark;
66
67 /***
68 * Private constructor to prevent creation of further instances.
69 * The static constants defined in this class are the only instantiations.
70 *
71 * @param featureMark the mark used to introduce features of this type
72 */
73 private FeatureType(final String featureMark) {
74 super();
75 mark = featureMark;
76 }
77
78 /***
79 * Returns the mark used to introduce features of this type.
80 *
81 * @return the mark
82 */
83 public String getMark() {
84 return mark;
85 }
86
87 /***
88 * Returns a string representation of this object.
89 *
90 * @return a textual representation
91 */
92 public String toString() {
93 return new ToStringBuilder(this)
94 .append("mark", mark)
95 .toString();
96 }
97
98 }