1 42 43 package org.jfree.chart.plot; 44 45 import java.io.ObjectStreamException ; 46 import java.io.Serializable ; 47 48 53 public final class DatasetRenderingOrder implements Serializable { 54 55 56 private static final long serialVersionUID = -600593412366385072L; 57 58 62 public static final DatasetRenderingOrder FORWARD 63 = new DatasetRenderingOrder("DatasetRenderingOrder.FORWARD"); 64 65 69 public static final DatasetRenderingOrder REVERSE 70 = new DatasetRenderingOrder("DatasetRenderingOrder.REVERSE"); 71 72 73 private String name; 74 75 80 private DatasetRenderingOrder(String name) { 81 this.name = name; 82 } 83 84 89 public String toString() { 90 return this.name; 91 } 92 93 101 public boolean equals(Object o) { 102 103 if (this == o) { 104 return true; 105 } 106 if (!(o instanceof DatasetRenderingOrder)) { 107 return false; 108 } 109 110 DatasetRenderingOrder order = (DatasetRenderingOrder) o; 111 if (!this.name.equals(order.toString())) { 112 return false; 113 } 114 115 return true; 116 117 } 118 119 126 private Object readResolve() throws ObjectStreamException { 127 if (this.equals(DatasetRenderingOrder.FORWARD)) { 128 return DatasetRenderingOrder.FORWARD; 129 } 130 else if (this.equals(DatasetRenderingOrder.REVERSE)) { 131 return DatasetRenderingOrder.REVERSE; 132 } 133 return null; 134 } 135 136 } 137 | Popular Tags |