1 | public final class DatasetRenderingOrder implements Serializable {↵ | | 1 | public final class SeriesRenderingOrder implements Serializable {↵
|
|
2 | /** For serialization. */↵ | | 2 | /** For serialization. */↵
|
3 | private static final long serialVersionUID = -600593412366385072L;↵ | | 3 | private static final long serialVersionUID = 209336477448807735L;↵
|
4 | ↵ | | 4 | ↵
|
|
5 | /** ↵ | | 5 | /**↵
|
6 | * Render datasets in the order 0, 1, 2, ..., N-1, where N is the number ↵ | | 6 | * Render series in the order 0, 1, 2, ..., N-1, where N is the number↵
|
7 | * of datasets. ↵ | | 7 | * of series.↵
|
8 | */↵ | | 8 | */↵
|
9 | public static final DatasetRenderingOrder FORWARD↵ | | 9 | public static final SeriesRenderingOrder FORWARD↵
|
10 | = new DatasetRenderingOrder("DatasetRenderingOrder.FORWARD");↵ | | 10 | = new SeriesRenderingOrder("SeriesRenderingOrder.FORWARD");↵
|
|
11 | /** ↵ | | 11 | /**↵
|
12 | * Render datasets in the order N-1, N-2, ..., 2, 1, 0, where N is the ↵ | | 12 | * Render series in the order N-1, N-2, ..., 2, 1, 0, where N is the↵
|
13 | * number of datasets. ↵ | | 13 | * number of series.↵
|
14 | */↵ | | 14 | */↵
|
15 | public static final DatasetRenderingOrder REVERSE↵ | | 15 | public static final SeriesRenderingOrder REVERSE↵
|
16 | = new DatasetRenderingOrder("DatasetRenderingOrder.REVERSE");↵ | | 16 | = new SeriesRenderingOrder("SeriesRenderingOrder.REVERSE");↵
|
|
17 | /** The name. */↵ | | 17 | /** The name. */↵
|
18 | private String name;↵ | | 18 | private String name;↵
|
|
19 | /**↵ | | 19 | /**↵
|
20 | * Private constructor.↵ | | 20 | * Private constructor.↵
|
21 | *↵ | | 21 | *↵
|
22 | * @param name the name.↵ | | 22 | * @param name the name.↵
|
23 | */↵ | | 23 | */↵
|
24 | private DatasetRenderingOrder(String name) {↵ | | 24 | private SeriesRenderingOrder(String name) {↵
|
25 | this.name = name;↵ | | 25 | this.name = name;↵
|
26 | }↵ | | 26 | }↵
|
|
27 | /**↵ | | 27 | /**↵
|
28 | * Returns a string representing the object.↵ | | 28 | * Returns a string representing the object.↵
|
29 | *↵ | | 29 | *↵
|
30 | * @return The string (never null ).↵ | | 30 | * @return The string (never null ).↵
|
31 | */↵ | | 31 | */↵
|
32 | public String toString() {↵ | | 32 | public String toString() {↵
|
33 | return this.name;↵ | | 33 | return this.name;↵
|
34 | }↵ | | 34 | }↵
|
|
35 | /**↵ | | 35 | /**↵
|
36 | * Returns true if this object is equal to the specified ↵ | | 36 | * Returns true if this object is equal to the specified↵
|
37 | * object, and false otherwise.↵ | | 37 | * object, and false otherwise.↵
|
38 | *↵ | | 38 | *↵
|
39 | * @param obj the object (null permitted).↵ | | 39 | * @param obj the object (null permitted).↵
|
40 | *↵ | | 40 | *↵
|
41 | * @return A boolean.↵ | | 41 | * @return A boolean.↵
|
42 | */↵ | | 42 | */↵
|
43 | public boolean equals(Object obj) {↵ | | 43 | public boolean equals(Object obj) {↵
|
44 | if (this == obj) {↵ | | 44 | if (this == obj) {↵
|
45 | return true;↵ | | 45 | return true;↵
|
46 | }↵ | | 46 | }↵
|
47 | if (!(obj instanceof DatasetRenderingOrder)) {↵ | | 47 | if (!(obj instanceof SeriesRenderingOrder)) {↵
|
48 | return false;↵ | | 48 | return false;↵
|
49 | }↵ | | 49 | }↵
|
50 | DatasetRenderingOrder order = (DatasetRenderingOrder) obj;↵ | | 50 | SeriesRenderingOrder order = (SeriesRenderingOrder) obj;↵
|
51 | if (!this.name.equals(order.toString())) {↵ | | 51 | if (!this.name.equals(order.toString())) {↵
|
52 | return false;↵ | | 52 | return false;↵
|
53 | }↵ | | 53 | }↵
|
54 | return true;↵ | | 54 | return true;↵
|
55 | }↵ | | 55 | }↵
|
56 | ↵ | | |
|
57 | /**↵ | | 56 | /**↵
|
58 | * Returns a hash code for this instance.↵ | | 57 | * Returns a hash code for this instance.↵
|
59 | * ↵ | | 58 | * ↵
|
60 | * @return A hash code.↵ | | 59 | * @return A hash code.↵
|
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 | /**↵ | | 65 | /**↵
|
67 | * Ensures that serialization returns the unique instances.↵ | | 66 | * Ensures that serialization returns the unique instances.↵
|
68 | * ↵ | | 67 | *↵
|
69 | * @return The object.↵ | | 68 | * @return The object.↵
|
70 | * ↵ | | 69 | *↵
|
71 | * @throws ObjectStreamException if there is a problem.↵ | | 70 | * @throws ObjectStreamException if there is a problem.↵
|
72 | */↵ | | 71 | */↵
|
73 | private Object readResolve() throws ObjectStreamException {↵ | | 72 | private Object readResolve() throws ObjectStreamException {↵
|
74 | if (this.equals(DatasetRenderingOrder.FORWARD)) {↵ | | 73 | if (this.equals(SeriesRenderingOrder.FORWARD)) {↵
|
75 | return DatasetRenderingOrder.FORWARD;↵ | | 74 | return SeriesRenderingOrder.FORWARD;↵
|
76 | }↵ | | 75 | }↵
|
77 | else if (this.equals(DatasetRenderingOrder.REVERSE)) {↵ | | 76 | else if (this.equals(SeriesRenderingOrder.REVERSE)) {↵
|
78 | return DatasetRenderingOrder.REVERSE;↵ | | 77 | return SeriesRenderingOrder.REVERSE;↵
|
79 | } ↵ | | 78 | }↵
|
80 | return null;↵ | | 79 | return null;↵
|
81 | | | 80 |
|