1 40 41 package org.jfree.chart.plot; 42 43 import java.io.ObjectStreamException ; 44 import java.io.Serializable ; 45 46 50 public final class SeriesRenderingOrder implements Serializable { 51 52 53 private static final long serialVersionUID = 209336477448807735L; 54 55 59 public static final SeriesRenderingOrder FORWARD 60 = new SeriesRenderingOrder("SeriesRenderingOrder.FORWARD"); 61 62 66 public static final SeriesRenderingOrder REVERSE 67 = new SeriesRenderingOrder("SeriesRenderingOrder.REVERSE"); 68 69 70 private String name; 71 72 77 private SeriesRenderingOrder(String name) { 78 this.name = name; 79 } 80 81 86 public String toString() { 87 return this.name; 88 } 89 90 98 public boolean equals(Object obj) { 99 100 if (this == obj) { 101 return true; 102 } 103 if (!(obj instanceof SeriesRenderingOrder)) { 104 return false; 105 } 106 107 SeriesRenderingOrder order = (SeriesRenderingOrder) obj; 108 if (!this.name.equals(order.toString())) { 109 return false; 110 } 111 112 return true; 113 114 } 115 116 123 private Object readResolve() throws ObjectStreamException { 124 if (this.equals(SeriesRenderingOrder.FORWARD)) { 125 return SeriesRenderingOrder.FORWARD; 126 } 127 else if (this.equals(SeriesRenderingOrder.REVERSE)) { 128 return SeriesRenderingOrder.REVERSE; 129 } 130 return null; 131 } 132 133 } 134 | Popular Tags |