1 42 43 package org.jfree.chart.renderer; 44 45 import java.io.ObjectStreamException ; 46 import java.io.Serializable ; 47 48 51 public final class AreaRendererEndType implements Serializable { 52 53 54 private static final long serialVersionUID = -1774146392916359839L; 55 56 59 public static final AreaRendererEndType TAPER = new AreaRendererEndType( 60 "AreaRendererEndType.TAPER" 61 ); 62 63 66 public static final AreaRendererEndType TRUNCATE = new AreaRendererEndType( 67 "AreaRendererEndType.TRUNCATE" 68 ); 69 70 73 public static final AreaRendererEndType LEVEL = new AreaRendererEndType( 74 "AreaRendererEndType.LEVEL" 75 ); 76 77 78 private String name; 79 80 85 private AreaRendererEndType(String name) { 86 this.name = name; 87 } 88 89 94 public String toString() { 95 return this.name; 96 } 97 98 106 public boolean equals(Object o) { 107 108 if (this == o) { 109 return true; 110 } 111 if (!(o instanceof AreaRendererEndType)) { 112 return false; 113 } 114 115 AreaRendererEndType t = (AreaRendererEndType) o; 116 if (!this.name.equals(t.toString())) { 117 return false; 118 } 119 120 return true; 121 122 } 123 124 131 private Object readResolve() throws ObjectStreamException { 132 Object result = null; 133 if (this.equals(AreaRendererEndType.LEVEL)) { 134 result = AreaRendererEndType.LEVEL; 135 } 136 else if (this.equals(AreaRendererEndType.TAPER)) { 137 result = AreaRendererEndType.TAPER; 138 } 139 else if (this.equals(AreaRendererEndType.TRUNCATE)) { 140 result = AreaRendererEndType.TRUNCATE; 141 } 142 return result; 143 } 144 145 } 146 | Popular Tags |