1 | public final class CategoryAnchor implements Serializable {↵ | | 1 | public final class ChartChangeEventType implements Serializable {↵
|
|
2 | /** For serialization. */↵ | | 2 | /** For serialization. */↵
|
3 | private static final long serialVersionUID = -2604142742210173810L;↵ | | 3 | private static final long serialVersionUID = 5481917022435735602L;↵
|
4 | ↵ | | 4 | ↵
|
5 | /** Start of period. */↵ | | 5 | /** GENERAL. */↵
|
6 | public static final CategoryAnchor START ↵ | | 6 | public static final C↵
|
7 | = new CategoryAnchor("CategoryAnchor.START");↵ | | |
|
|
8 | /** Middle of period. */↵ | | |
|
9 | public static final CategoryAnchor MIDDLE ↵ | | |
|
10 | = new CategoryAnchor("CategoryAnchor.MIDDLE");↵ | | |
|
|
11 | /** End of period. */↵ | | |
|
12 | public static final CategoryAnchor END ↵ | | 7 | hartChangeEventType GENERAL ↵
|
| | | 8 | = new ChartChangeEventType("ChartChangeEventType.GENERAL");↵
|
|
| | | 9 | /** NEW_DATASET. */↵
|
| | | 10 | public static final ChartChangeEventType NEW_DATASET ↵
|
| | | 11 | = new ChartChangeEventType("ChartChangeEventType.NEW_DATASET");↵
|
|
| | | 12 | /** DATASET_UPDATED. */↵
|
| | | 13 | public static final ChartChangeEventType DATASET_UPDATED↵
|
13 | = new CategoryAnchor("CategoryAnchor.END");↵ | | 14 | = new ChartChangeEventType("ChartChangeEventType.DATASET_UPDATED");↵
|
|
14 | /** The name. */↵ | | 15 | /** The name. */↵
|
15 | private String name;↵ | | 16 | private String name;↵
|
|
16 | /**↵ | | 17 | /**↵
|
17 | * Private constructor.↵ | | 18 | * Private constructor.↵
|
18 | *↵ | | 19 | *↵
|
19 | * @param name the name.↵ | | 20 | * @param name the name.↵
|
20 | */↵ | | 21 | */↵
|
21 | private CategoryAnchor(String name) {↵ | | 22 | private ChartChangeEventType(String name) {↵
|
22 | this.name = name;↵ | | 23 | this.name = name;↵
|
23 | }↵ | | 24 | }↵
|
|
24 | /**↵ | | 25 | /**↵
|
25 | * Returns a string representing the object.↵ | | 26 | * Returns a string representing the object.↵
|
26 | *↵ | | 27 | *↵
|
27 | * @return The string.↵ | | 28 | * @return The string.↵
|
28 | */↵ | | 29 | */↵
|
29 | public String toString() {↵ | | 30 | public String toString() {↵
|
30 | return this.name;↵ | | 31 | return this.name;↵
|
31 | }↵ | | 32 | }↵
|
|
32 | /**↵ | | 33 | /**↵
|
33 | * Returns <code>true</code> if this object is equal to the specified ↵ | | 34 | * Returns <code>true</code> if this object is equal to the specified ↵
|
34 | * object, and <code>false</code> otherwise.↵ | | 35 | * object, and <code>false</code> otherwise.↵
|
35 | *↵ | | 36 | *↵
|
36 | * @param obj the other object.↵ | | 37 | * @param obj the object (<code>null</code> permitted).↵
|
37 | *↵ | | 38 | *↵
|
38 | * @return A boolean.↵ | | 39 | * @return A boolean.↵
|
39 | */↵ | | 40 | */↵
|
40 | public boolean equals(Object obj) {↵ | | 41 | public boolean equals(Object obj) {↵
|
|
41 | if (this == obj) {↵ | | 42 | if (this == obj) {↵
|
42 | return true;↵ | | 43 | return true;↵
|
43 | }↵ | | 44 | }↵
|
44 | if (!(obj instanceof CategoryAnchor)) {↵ | | 45 | if (!(obj instanceof ChartChangeEventType)) {↵
|
45 | return false;↵ | | 46 | return false;↵
|
46 | }↵ | | 47 | }↵
|
47 | CategoryAnchor position = (CategoryAnchor) obj;↵ | | 48 | ChartChangeEventType that = (ChartChangeEventType) obj;↵
|
48 | if (!this.name.equals(position.toString())) {↵ | | 49 | if (!this.name.equals(that.toString())) {↵
|
49 | return false;↵ | | 50 | return false;↵
|
50 | }↵ | | 51 | }↵
|
51 | return true;↵ | | 52 | return true;↵
|
| | | 53 | }↵
|
52 | }↵ | | 54 | ↵
|
53 | ↵ | | 55 | /**↵
|
| | | 56 | * Returns a hash code value for the object.↵
|
| | | 57 | *↵
|
| | | 58 | * @return The hashcode↵
|
| | | 59 | */↵
|
| | | 60 | public int hashCode() {↵
|
| | | 61 | return this.name.hashCode();↵
|
| | | 62 | }↵
|
|
54 | /**↵ | | 63 | /**↵
|
55 | * Ensures that serialization returns the unique instances.↵ | | 64 | * Ensures that serialization returns the unique instances.↵
|
56 | * ↵ | | 65 | * ↵
|
57 | * @return The object.↵ | | 66 | * @return The object.↵
|
58 | * ↵ | | 67 | * ↵
|
59 | * @throws ObjectStreamException if there is a problem.↵ | | 68 | * @throws ObjectStreamException if there is a problem.↵
|
60 | */↵ | | 69 | */↵
|
61 | private Object readResolve() throws ObjectStreamException {↵ | | 70 | private Object readResolve() throws ObjectStreamException {↵
|
62 | if (this.equals(CategoryAnchor.START)) {↵ | | 71 | if (this.equals(C↵
|
63 | return CategoryAnchor.START↵ | | 72 | hartChangeEventType.GENERAL)) {↵
|
64 | ;↵ | | 73 | return ChartChangeEventType.GENERAL;↵
|
65 | }↵ | | 74 | }↵
|
66 | else if (this.equals(CategoryAnchor.MIDDLE)) {↵ | | 75 | else if (this.equals(C↵
|
67 | return CategoryAnchor.MIDDLE↵ | | 76 | hartChangeEventType.NEW_DATASET)) {↵
|
68 | ;↵ | | 77 | return ChartChangeEventType.NEW_DATASET;↵
|
69 | } ↵ | | 78 | }↵
|
70 | else if (this.equals(CategoryAnchor.END)) {↵ | | 79 | else if (this.equals(C↵
|
71 | return CategoryAnchor.EN↵ | | 80 | hartChangeEventType.DATASET_UPDATED)) {↵
|
72 | D;↵ | | 81 | return ChartChangeEventType.DATASET_UPDATED;↵
|
73 | } ↵ | | 82 | }↵
|
74 | return null | | 83 | return null
|