public final class XYCoordinateType implements Serializable { /** The (x, y) coordinates represent a point in the data space. */ public static final XYCoordinateType DATA = new XYCoordinateType("XYCoordinateType.DATA"); /** * The (x, y) coordinates represent a relative position in the data space. * In this case, the values should be in the range (0.0 to 1.0). */ public static final XYCoordinateType RELATIVE = new XYCoordinateType("XYCoordinateType.RELATIVE"); /** * The (x, y) coordinates represent indices in a dataset. * In this case, the values should be in the range (0.0 to 1.0). */ public static final XYCoordinateType INDEX = new XYCoordinateType("XYCoordinateType.INDEX"); /** The name. */ private String name; /** * Private constructor. * * @param name the name. */ private XYCoordinateType(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 XYCoordinateType)) { return false; } XYCoordinateType order = (XYCoordinateType) obj; if (!this.name.equals(order.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(XYCoordinateType.DATA)) { return XYCoordinateType.DATA; } else if (this.equals(XYCoordinateType.RELATIVE)) { return XYCoordinateType.RELATIVE; } else if (this.equals(XYCoordinateType.INDEX)) { return XYCoordinateType.INDEX; } return null
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
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/experimental/org/jfree/experimental/chart/util/XYCoordinateType.java File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryAnchor.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public final class XYCoordinateType implements Serializable {
1
public final class CategoryAnchor implements Serializable {
2
    
2

3
    /** The (x, y) coordinates represent a point in the data space
3
    /** For serialization. */
4
    private static final long serialVersionUID = -2604142742210173810L;
5
    
4
. */
6
    /** Start of period. */
5
    public static final XYCoordinateType DATA 
7
    public static final CategoryAnchor START 
6
            = new XYCoordinateType("XYCoordinateType.DATA");
8
        = new 
7
    /** 
8
     * The (x, y) coordinates represent a relative position in the data space. 
9
     * In this case, the values should be in the range (0.0 to 1.0).
10
    
9
CategoryAnchor("CategoryAnchor.START");
11
 */
10
    /** Middle of period. */
12
    public static final XYCoordinateType RELATIVE 
11
    public static final 
13
            = new XYCoordinateType("XYCoordinateType.RELATIV
12
CategoryAnchor MIDDLE 
14
E");
13
        = new CategoryAnchor("CategoryAnchor.MIDDLE");
14

15
    /** 
15
    /** 
16
     * The (x, y) coordinates represent indices in a dataset. 
17
     * In this case, the values should be in the range (0.0 to 1.0).
18
     */
16
End of period. */
19
    public static final XYCoordinateType INDEX 
17
    public static final 
20
  
18
CategoryAnchor END 
21
          = new XYCoordinateType("XYCoordinateType.INDEX");
19
        = new 
20
CategoryAnchor("CategoryAnchor.END");
21

22
    /** The name. */
22
    /** The name. */
23
    private String name;
23
    private String name;
24

24
    /**
25
    /**
25
     * Private constructor.
26
     * Private constructor.
26
     *
27
     *
27
     * @param name  the name.
28
     * @param name  the name.
28
     */
29
     */
29
    private XYCoordinateType(String name) {
30
    private CategoryAnchor(String name) {
30
        this.name = name;
31
        this.name = name;
31
    }
32
    }
33

32
    /**
34
    /**
33
     * Returns a string representing the object.
35
     * Returns a string representing the object.
34
     *
36
     *
35
     * @return The string.
37
     * @return The string.
36
     */
38
     */
37
    public String toString() {
39
    public String toString() {
38
        return this.name;
40
        return this.name;
39
    }
41
    }
42

40
    /**
43
    /**
41
     * 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 
42
     * object, and <code>false</code> otherwise.
45
     * object, and <code>false</code> otherwise.
43
     *
46
     *
44
     * @param obj  the other object.
47
     * @param obj  the other object.
45
     *
48
     *
46
     * @return A boolean.
49
     * @return A boolean.
47
     */
50
     */
48
    public boolean equals(Object obj) {
51
    public boolean equals(Object obj) {
52

49
        if (this == obj) {
53
        if (this == obj) {
50
            return true;
54
            return true;
51
        }
55
        }
52
        if (!(obj instanceof XYCoordinateType)) {
56
        if (!(obj instanceof CategoryAnchor)) {
53
            return false;
57
            return false;
54
        }
58
        }
55
        XYCoordinateType order = (XYCoordinateType) obj;
59
        CategoryAnchor position = (CategoryAnchor) obj;
56
        if (!this.name.equals(order.toString())) {
60
        if (!this.name.equals(position.toString())) {
57
            return false;
61
            return false;
58
        }
62
        }
59
        return true;
63
        return true;
64

60
    }
65
    }
61
   
66
    
62
    /**
67
    /**
63
     * Ensures that serialization returns the unique instances.
68
     * Ensures that serialization returns the unique instances.
64
     *
69
     * 
65
     * @return The object.
70
     * @return The object.
66
     *
71
     * 
67
     * @throws ObjectStreamException if there is a problem.
72
     * @throws ObjectStreamException if there is a problem.
68
     */
73
     */
69
    private Object readResolve() throws ObjectStreamException {
74
    private Object readResolve() throws ObjectStreamException {
70
        if (this.equals(XYCoordinateType.DATA)) {
75
        if (this.equals(CategoryAnchor.START)) {
71
            return XYCoordinateType.DATA;
76
            return CategoryAnchor.START;
72
        }
77
        }
73
        else if (this.equals(XYCoordinateType.RELATIVE)) {
78
        else if (this.equals(CategoryAnchor.MIDDLE)) {
74
            return XYCoordinateType.RELATIVE;
79
            return CategoryAnchor.MIDDLE;
75
        }     
80
        }    
76
        else if (this.equals(XYCoordinateType.INDEX)) {
81
        else if (this.equals(CategoryAnchor.END)) {
77
            return XYCoordinateType.INDEX;
82
            return CategoryAnchor.END;
78
        }     
83
        }    
79
        return null
84
        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