1 41 42 package org.jfree.chart.axis; 43 44 import java.io.ObjectStreamException ; 45 import java.io.Serializable ; 46 47 51 public final class DateTickMarkPosition implements Serializable { 52 53 54 private static final long serialVersionUID = 2540750672764537240L; 55 56 57 public static final DateTickMarkPosition START 58 = new DateTickMarkPosition("DateTickMarkPosition.START"); 59 60 61 public static final DateTickMarkPosition MIDDLE 62 = new DateTickMarkPosition("DateTickMarkPosition.MIDDLE"); 63 64 65 public static final DateTickMarkPosition END 66 = new DateTickMarkPosition("DateTickMarkPosition.END"); 67 68 69 private String name; 70 71 76 private DateTickMarkPosition(String name) { 77 this.name = name; 78 } 79 80 85 public String toString() { 86 return this.name; 87 } 88 89 97 public boolean equals(Object obj) { 98 99 if (this == obj) { 100 return true; 101 } 102 if (!(obj instanceof DateTickMarkPosition)) { 103 return false; 104 } 105 DateTickMarkPosition position = (DateTickMarkPosition) obj; 106 if (!this.name.equals(position.toString())) { 107 return false; 108 } 109 return true; 110 111 } 112 113 120 private Object readResolve() throws ObjectStreamException { 121 if (this.equals(DateTickMarkPosition.START)) { 122 return DateTickMarkPosition.START; 123 } 124 else if (this.equals(DateTickMarkPosition.MIDDLE)) { 125 return DateTickMarkPosition.MIDDLE; 126 } 127 else if (this.equals(DateTickMarkPosition.END)) { 128 return DateTickMarkPosition.END; 129 } 130 return null; 131 } 132 133 134 } 135 | Popular Tags |