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