1 | public final class DateTickMarkPosition implements Serializable {↵ | | 1 | public final class LengthConstraintType implements Serializable {↵
|
|
2 | /** For serialization. */↵ | | 2 | /** For serialization. */↵
|
3 | private static final long serialVersionUID = 2540750672764537240L;↵ | | 3 | private static final long serialVersionUID = -1156658804028142978L;↵
|
4 | ↵ | | 4 | ↵
|
5 | /** Start of period. */↵ | | 5 | /** NONE. */↵
|
6 | public static final DateTickMarkPosition START↵ | | 6 | public static final ↵
|
7 | = new DateTickMarkPosition("DateTickMarkPosition.START");↵ | | |
|
|
8 | /** Middle of period↵ | | 7 | LengthConstraintType NONE ↵
|
| | | 8 | = new LengthConstraintType("LengthConstraintType.NONE");↵
|
|
9 | . */↵ | | 9 | /** Range. */↵
|
10 | public static final DateTickMarkPosition MIDDLE↵ | | 10 | public static final ↵
|
11 | = new DateTickMarkPosition("DateTickMarkPosition.MIDDL↵ | | 11 | LengthConstraintType RANGE ↵
|
12 | E");↵ | | 12 | = new LengthConstraintType("RectangleConstraintType.RANGE");↵
|
|
13 | /** End of period. */↵ | | 13 | /** FIXED. */↵
|
14 | public static final DateTickMarkPosition END↵ | | 14 | public static final ↵
|
15 | = new DateTickMarkPosition("DateTickMarkPosition.EN↵ | | 15 | LengthConstraintType FIXED ↵
|
16 | D");↵ | | 16 | = new LengthConstraintType("LengthConstraintType.FIXED");↵
|
|
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 DateTickMarkPosition(String name) {↵ | | 24 | private LengthConstraintType(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.↵ | | 30 | * @return The string.↵
|
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 other object.↵ | | 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 DateTickMarkPosition)) {↵ | | 47 | if (!(obj instanceof LengthConstraintType)) {↵
|
48 | return false;↵ | | 48 | return false;↵
|
49 | }↵ | | 49 | }↵
|
50 | DateTickMarkPosition position = (DateTickMarkPosition) obj;↵ | | 50 | LengthConstraintType that = (LengthConstraintType) obj;↵
|
51 | if (!this.name.equals(position.toString())) {↵ | | 51 | if (!this.name.equals(that.toString())) {↵
|
52 | return false;↵ | | 52 | return false;↵
|
53 | }↵ | | 53 | }↵
|
54 | return true;↵ | | 54 | return true;↵
|
| | | 55 | }↵
|
55 | }↵ | | 56 | ↵
|
56 | ↵ | | 57 | /**↵
|
| | | 58 | * Returns a hash code value for the object.↵
|
| | | 59 | *↵
|
| | | 60 | * @return The hashcode↵
|
| | | 61 | */↵
|
| | | 62 | public int hashCode() {↵
|
| | | 63 | return this.name.hashCode();↵
|
| | | 64 | }↵
|
|
57 | /**↵ | | 65 | /**↵
|
58 | * Ensures that serialization returns the unique instances.↵ | | 66 | * Ensures that serialization returns the unique instances.↵
|
59 | * ↵ | | 67 | * ↵
|
60 | * @return The object.↵ | | 68 | * @return The object.↵
|
61 | * ↵ | | 69 | * ↵
|
62 | * @throws ObjectStreamException if there is a problem.↵ | | 70 | * @throws ObjectStreamException if there is a problem.↵
|
63 | */↵ | | 71 | */↵
|
64 | private Object readResolve() throws ObjectStreamException {↵ | | 72 | private Object readResolve() throws ObjectStreamException {↵
|
65 | if (this.equals(DateTickMarkPosition.START)) {↵ | | 73 | if (this.equals(↵
|
66 | return DateTickMarkPosition.START↵ | | 74 | LengthConstraintType.NONE)) {↵
|
67 | ;↵ | | 75 | return LengthConstraintType.NONE;↵
|
68 | }↵ | | 76 | }↵
|
69 | else if (this.equals(DateTickMarkPosition.MIDDLE)) {↵ | | 77 | else if (this.equals(↵
|
70 | return DateTickMarkPosition.MIDDL↵ | | 78 | LengthConstraintType.RANGE)) {↵
|
71 | E;↵ | | 79 | return LengthConstraintType.RANGE;↵
|
72 | } ↵ | | 80 | }↵
|
73 | else if (this.equals(DateTickMarkPosition.END)) {↵ | | 81 | else if (this.equals(LengthConstraintType.FIXED)) {↵
|
74 | return DateTickMarkPosition.END;↵ | | 82 | return LengthConstraintType.FIXED;↵
|
75 | } ↵ | | 83 | }↵
|
76 | return null;↵ | | 84 | return null;↵
|
77 | | | 85 |
|