public final class CategoryAnchor implements Serializable { /** For serialization. */ private static final long serialVersionUID = -2604142742210173810L; /** Start of period. */ public static final CategoryAnchor START = new CategoryAnchor("CategoryAnchor.START"); /** Middle of period. */ public static final CategoryAnchor MIDDLE = new CategoryAnchor("CategoryAnchor.MIDDLE"); /** End of period. */ public static final CategoryAnchor END = new CategoryAnchor("CategoryAnchor.END"); /** The name. */ private String name; /** * Private constructor. * * @param name the name. */ private CategoryAnchor(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 other object. * * @return A boolean. */ public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof CategoryAnchor)) { return false; } CategoryAnchor position = (CategoryAnchor) obj; if (!this.name.equals(position.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 { if (this.equals(CategoryAnchor.START)) { return CategoryAnchor.START; } else if (this.equals(CategoryAnchor.MIDDLE)) { return CategoryAnchor.MIDDLE; } else if (this.equals(CategoryAnchor.END)) { return CategoryAnchor.END; } return null
public final class ChartChangeEventType implements Serializable { /** For serialization. */ private static final long serialVersionUID = 5481917022435735602L; /** GENERAL. */ public static final ChartChangeEventType GENERAL = new ChartChangeEventType("ChartChangeEventType.GENERAL"); /** NEW_DATASET. */ public static final ChartChangeEventType NEW_DATASET = new ChartChangeEventType("ChartChangeEventType.NEW_DATASET"); /** DATASET_UPDATED. */ public static final ChartChangeEventType DATASET_UPDATED = new ChartChangeEventType("ChartChangeEventType.DATASET_UPDATED"); /** The name. */ private String name; /** * Private constructor. * * @param name the name. */ private ChartChangeEventType(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 ChartChangeEventType)) { return false; } ChartChangeEventType that = (ChartChangeEventType) obj; if (!this.name.equals(that.toString())) { return false; } return true; } /** * Returns a hash code value for the object. * * @return The hashcode */ 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 { if (this.equals(ChartChangeEventType.GENERAL)) { return ChartChangeEventType.GENERAL; } else if (this.equals(ChartChangeEventType.NEW_DATASET)) { return ChartChangeEventType.NEW_DATASET; } else if (this.equals(ChartChangeEventType.DATASET_UPDATED)) { return ChartChangeEventType.DATASET_UPDATED; } return null
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryAnchor.java File path: /jfreechart-1.0.10/src/org/jfree/chart/event/ChartChangeEventType.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public final class CategoryAnchor implements Serializable {
1
public final class ChartChangeEventType implements Serializable {
2
    /** For serialization. */
2
    /** For serialization. */
3
    private static final long serialVersionUID = -2604142742210173810L;
3
    private static final long serialVersionUID = 5481917022435735602L;
4
    
4
    
5
    /** Start of period. */
5
    /** GENERAL. */
6
    public static final CategoryAnchor START 
6
    public static final C
7
        = new CategoryAnchor("CategoryAnchor.START");
8
    /** Middle of period. */
9
    public static final CategoryAnchor MIDDLE 
10
        = new CategoryAnchor("CategoryAnchor.MIDDLE");
11
    /** End of period. */
12
    public static final CategoryAnchor END 
7
hartChangeEventType GENERAL 
8
            = new ChartChangeEventType("ChartChangeEventType.GENERAL");
9
    /** NEW_DATASET. */
10
    public static final ChartChangeEventType NEW_DATASET 
11
            = new ChartChangeEventType("ChartChangeEventType.NEW_DATASET");
12
    /** DATASET_UPDATED. */
13
    public static final ChartChangeEventType DATASET_UPDATED
13
        = new CategoryAnchor("CategoryAnchor.END");
14
            = new ChartChangeEventType("ChartChangeEventType.DATASET_UPDATED");
14
    /** The name. */
15
    /** The name. */
15
    private String name;
16
    private String name;
16
    /**
17
    /**
17
     * Private constructor.
18
     * Private constructor.
18
     *
19
     *
19
     * @param name  the name.
20
     * @param name  the name.
20
     */
21
     */
21
    private CategoryAnchor(String name) {
22
    private ChartChangeEventType(String name) {
22
        this.name = name;
23
        this.name = name;
23
    }
24
    }
24
    /**
25
    /**
25
     * Returns a string representing the object.
26
     * Returns a string representing the object.
26
     *
27
     *
27
     * @return The string.
28
     * @return The string.
28
     */
29
     */
29
    public String toString() {
30
    public String toString() {
30
        return this.name;
31
        return this.name;
31
    }
32
    }
32
    /**
33
    /**
33
     * Returns <code>true</code> if this object is equal to the specified 
34
     * Returns <code>true</code> if this object is equal to the specified 
34
     * object, and <code>false</code> otherwise.
35
     * object, and <code>false</code> otherwise.
35
     *
36
     *
36
     * @param obj  the other object.
37
     * @param obj  the object (<code>null</code> permitted).
37
     *
38
     *
38
     * @return A boolean.
39
     * @return A boolean.
39
     */
40
     */
40
    public boolean equals(Object obj) {
41
    public boolean equals(Object obj) {
41
        if (this == obj) {
42
        if (this == obj) {
42
            return true;
43
            return true;
43
        }
44
        }
44
        if (!(obj instanceof CategoryAnchor)) {
45
        if (!(obj instanceof ChartChangeEventType)) {
45
            return false;
46
            return false;
46
        }
47
        }
47
        CategoryAnchor position = (CategoryAnchor) obj;
48
        ChartChangeEventType that = (ChartChangeEventType) obj;
48
        if (!this.name.equals(position.toString())) {
49
        if (!this.name.equals(that.toString())) {
49
            return false;
50
            return false;
50
        }
51
        }
51
        return true;
52
        return true;
53
    }
52
    }
54
    
53
    
55
    /**
56
     * Returns a hash code value for the object.
57
     *
58
     * @return The hashcode
59
     */
60
    public int hashCode() {
61
        return this.name.hashCode();
62
    }
54
    /**
63
    /**
55
     * Ensures that serialization returns the unique instances.
64
     * Ensures that serialization returns the unique instances.
56
     * 
65
     * 
57
     * @return The object.
66
     * @return The object.
58
     * 
67
     * 
59
     * @throws ObjectStreamException if there is a problem.
68
     * @throws ObjectStreamException if there is a problem.
60
     */
69
     */
61
    private Object readResolve() throws ObjectStreamException {
70
    private Object readResolve() throws ObjectStreamException {
62
        if (this.equals(CategoryAnchor.START)) {
71
        if (this.equals(C
63
            return CategoryAnchor.START
72
hartChangeEventType.GENERAL)) {
64
;
73
            return ChartChangeEventType.GENERAL;
65
        }
74
        }
66
        else if (this.equals(CategoryAnchor.MIDDLE)) {
75
        else if (this.equals(C
67
            return CategoryAnchor.MIDDLE
76
hartChangeEventType.NEW_DATASET)) {
68
;
77
            return ChartChangeEventType.NEW_DATASET;
69
        }    
78
        }
70
        else if (this.equals(CategoryAnchor.END)) {
79
        else if (this.equals(C
71
            return CategoryAnchor.EN
80
hartChangeEventType.DATASET_UPDATED)) {
72
D;
81
            return ChartChangeEventType.DATASET_UPDATED;
73
        }    
82
        }
74
        return null
83
        return null
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