public final class PieLabelLinkStyle implements Serializable { /** STANDARD. */ public static final PieLabelLinkStyle STANDARD = new PieLabelLinkStyle("PieLabelLinkStyle.STANDARD"); /** QUAD_CURVE. */ public static final PieLabelLinkStyle QUAD_CURVE = new PieLabelLinkStyle("PieLabelLinkStyle.QUAD_CURVE"); /** CUBIC_CURVE. */ public static final PieLabelLinkStyle CUBIC_CURVE = new PieLabelLinkStyle("PieLabelLinkStyle.CUBIC_CURVE"); /** The name. */ private String name; /** * Private constructor. * * @param name the name. */ private PieLabelLinkStyle(String name) { this.name = name; } /** * Returns a string representing the object. * * @return The string. */ public String toString() { return this.name; } /** * Returns <code>true</code> if this object is equal to the specified * object, and <code>false</code> otherwise. * * @param obj the object (<code>null</code> permitted). * * @return A boolean. */ public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof PieLabelLinkStyle)) { return false; } PieLabelLinkStyle style = (PieLabelLinkStyle) obj; if (!this.name.equals(style.toString())) { return false; } return true; } /** * Returns a hash code for this instance. * * @return A hash code. */ public int hashCode() { return this.name.hashCode(); } /** * Ensures that serialization returns the unique instances. * * @return The object. * * @throws ObjectStreamException if there is a problem. */ private Object readResolve() throws ObjectStreamException { Object result = null; if (this.equals(PieLabelLinkStyle.STANDARD)) { result = PieLabelLinkStyle.STANDARD; } else if (this.equals(PieLabelLinkStyle.QUAD_CURVE)) { result = PieLabelLinkStyle.QUAD_CURVE; } else if (this.equals(PieLabelLinkStyle.CUBIC_CURVE)) { result = PieLabelLinkStyle.CUBIC_CURVE; } return result
public final class AreaRendererEndType implements Serializable { /** For serialization. */ private static final long serialVersionUID = -1774146392916359839L; /** * The area tapers from the first or last value down to zero. */ public static final AreaRendererEndType TAPER = new AreaRendererEndType( "AreaRendererEndType.TAPER" ); /** * The area is truncated at the first or last value. */ public static final AreaRendererEndType TRUNCATE = new AreaRendererEndType( "AreaRendererEndType.TRUNCATE" ); /** * The area is levelled at the first or last value. */ public static final AreaRendererEndType LEVEL = new AreaRendererEndType( "AreaRendererEndType.LEVEL" ); /** The name. */ private String name; /** * Private constructor. * * @param name the name. */ private AreaRendererEndType(String name) { this.name = name; } /** * Returns a string representing the object. * * @return The string. */ public String toString() { return this.name; } /** * Returns <code>true</code> if this object is equal to the specified * object, and <code>false</code> otherwise. * * @param o the other object. * * @return A boolean. */ public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof AreaRendererEndType)) { return false; } AreaRendererEndType t = (AreaRendererEndType) o; if (!this.name.equals(t.toString())) { return false; } return true; } /** * Ensures that serialization returns the unique instances. * * @return The object. * * @throws ObjectStreamException if there is a problem. */ private Object readResolve() throws ObjectStreamException { Object result = null; if (this.equals(AreaRendererEndType.LEVEL)) { result = AreaRendererEndType.LEVEL; } else if (this.equals(AreaRendererEndType.TAPER)) { result = AreaRendererEndType.TAPER; } else if (this.equals(AreaRendererEndType.TRUNCATE)) { result = AreaRendererEndType.TRUNCATE; } return result
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PieLabelLinkStyle.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/AreaRendererEndType.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public final class PieLabelLinkStyle implements Serializable {
1
public final class AreaRendererEndType implements Serializable {
2
    
3
    /** STANDARD. */
2
    /** For serialization. */
4
    public static final PieLabelLinkStyle STANDARD
3
    private static final 
5
            = new PieLabelLinkStyle("PieLabelLinkStyl
4
long serialVersionUID = -1774146392916359839L;
5
    
6
    /** 
7
     * The area tapers from the first or last value down to zero. 
8
     */
9
    public static final AreaRendererEndType TAPER = new AreaRendererEndType(
6
e.STANDARD"
10
        "AreaRendererEndType.TAPER"
7
);
11
    );
8
    /** QUAD_CURVE. */
12
    /** 
9
    public static final PieLabelLinkStyle QUAD_CURVE
10
            = new PieLabelLinkStyle("PieLabelLinkStyle.QUAD_CURVE");
11
    /** CUBIC_CURVE. */
12
    public static final PieLabelLinkStyle CUBIC_CURVE
13
            = new PieLabelLinkStyle("PieLabelLinkStyle.CUBIC_CURVE"
13
     * The area is truncated at the first or last value. 
14
     */
15
    public static final AreaRendererEndType TRUNCATE = new AreaRendererEndType(
16
        "AreaRendererEndType.TRUNCATE"
17
    );
18
    
19
    /** 
20
     * The area is levelled at the first or last value. 
21
     */
22
    public static final AreaRendererEndType LEVEL = new AreaRendererEndType(
23
        "AreaRendererEndType.LEVEL"
14
);
24
    );
15
    /** The name. */
25
    /** The name. */
16
    private String name;
26
    private String name;
17
    /**
27
    /**
18
     * Private constructor.
28
     * Private constructor.
19
     *
29
     *
20
     * @param name  the name.
30
     * @param name  the name.
21
     */
31
     */
22
    private PieLabelLinkStyle(String name) {
32
    private AreaRendererEndType(String name) {
23
        this.name = name;
33
        this.name = name;
24
    }
34
    }
25
    /**
35
    /**
26
     * Returns a string representing the object.
36
     * Returns a string representing the object.
27
     *
37
     *
28
     * @return The string.
38
     * @return The string.
29
     */
39
     */
30
    public String toString() {
40
    public String toString() {
31
        return this.name;
41
        return this.name;
32
    }
42
    }
33
    /**
43
    /**
34
     * Returns <code>true</code> if this object is equal to the specified 
44
     * Returns <code>true</code> if this object is equal to the specified 
35
     * object, and <code>false</code> otherwise.
45
     * object, and <code>false</code> otherwise.
36
     *
46
     *
37
     * @param obj  the object (<code>null</code> permitted).
47
     * @param o  the other object.
38
     *
48
     *
39
     * @return A boolean.
49
     * @return A boolean.
40
     */
50
     */
41
    public boolean equals(Object obj) {
51
    public boolean equals(Object o) {
42
        if (this == obj) {
52
        if (this == o) {
43
            return true;
53
            return true;
44
        }
54
        }
45
        if (!(obj instanceof PieLabelLinkStyle)) {
55
        if (!(o instanceof AreaRendererEndType)) {
46
            return false;
56
            return false;
47
        }
57
        }
48
        PieLabelLinkStyle style = (PieLabelLinkStyle) obj;
58
        AreaRendererEndType t = (AreaRendererEndType) o;
49
        if (!this.name.equals(style.toString())) {
59
        if (!this.name.equals(t.toString())) {
50
            return false;
60
            return false;
51
        }
61
        }
52
        return true;
62
        return true;
53
    }
54
    
55
    /**
56
     * Returns a hash code for this instance.
57
     * 
58
     * @return A hash code.
59
     */
60
    public int hashCode() {
61
        return this.name.hashCode();
62
    }
63
    }
63
    
64
    
64
    /**
65
    /**
65
     * Ensures that serialization returns the unique instances.
66
     * Ensures that serialization returns the unique instances.
66
     * 
67
     * 
67
     * @return The object.
68
     * @return The object.
68
     * 
69
     * 
69
     * @throws ObjectStreamException if there is a problem.
70
     * @throws ObjectStreamException if there is a problem.
70
     */
71
     */
71
    private Object readResolve() throws ObjectStreamException {
72
    private Object readResolve() throws ObjectStreamException {
72
        Object result = null;
73
        Object result = null;
73
        if (this.equals(PieLabelLinkStyle.STANDARD)) {
74
        if (this.equals(AreaRendererEndType.LEVEL)) {
74
            result = PieLabelLinkStyle.STANDARD;
75
            result = AreaRendererEndType.LEVEL;
75
        }
76
        }
76
        else if (this.equals(PieLabelLinkStyle.QUAD_CURVE)) {
77
        else if (this.equals(
77
            result = PieLabelLinkStyle.QUAD_CURVE
78
AreaRendererEndType.TAPER)) {
78
;
79
            result = AreaRendererEndType.TAPER;
79
        }
80
        }
80
        else if (this.equals(PieLabelLinkStyle.CUBIC_CURVE)) {
81
        else if (this.equals(
81
            result = PieLabelLinkStyle.CUBIC_CURV
82
AreaRendererEndType.TRUNCATE)) {
82
E;
83
            result = AreaRendererEndType.TRUNCATE;
83
        }
84
        }
84
        return result
85
        return result
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0