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 DateTickMarkPosition implements Serializable { /** For serialization. */ private static final long serialVersionUID = 2540750672764537240L; /** Start of period. */ public static final DateTickMarkPosition START = new DateTickMarkPosition("DateTickMarkPosition.START"); /** Middle of period. */ public static final DateTickMarkPosition MIDDLE = new DateTickMarkPosition("DateTickMarkPosition.MIDDLE"); /** End of period. */ public static final DateTickMarkPosition END = new DateTickMarkPosition("DateTickMarkPosition.END"); /** The name. */ private String name; /** * Private constructor. * * @param name the name. */ private DateTickMarkPosition(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 DateTickMarkPosition)) { return false; } DateTickMarkPosition position = (DateTickMarkPosition) 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(DateTickMarkPosition.START)) { return DateTickMarkPosition.START; } else if (this.equals(DateTickMarkPosition.MIDDLE)) { return DateTickMarkPosition.MIDDLE; } else if (this.equals(DateTickMarkPosition.END)) { return DateTickMarkPosition.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/DateTickMarkPosition.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 DateTickMarkPosition implements Serializable {
2
    
2

3
    /** The (x, y) coordinates represent a point in the data space. */
3
    /** For serialization. */
4
    public static final XYCoordinateType DATA 
4
    private static final 
5
            = new XYCoordinateType("XYCoordinateType.DATA");
6
    /** 
7
     * The (x, y) coordinates represent a relative position in the data space. 
8
     * In this case, the values should be in the range (0.0 to 1.0).
9
    
5
long serialVersionUID = 2540750672764537240L;
6
    
10
 */
7
    /** Start of period. */
11
    public static final XYCoordinateType RELATIVE 
8
    public static final 
12
   
9
DateTickMarkPosition START
13
         = new XYCoordinateType("XYCoordinateType.RELATIVE");
10
        = new 
14
    /** 
15
     * The (x, y) coordinates represent indices in a dataset. 
16
     * In this case, the values should be in the range (0.0 to 1.0).
17
    
11
DateTickMarkPosition("DateTickMarkPosition.START");
12
    /** Middle of period. */
13
    public static final DateTickMarkPosition MIDDLE
14
        = new DateTickMarkPosition("DateTickMarkPosition.MIDDLE");
18
 */
15
    /** End of period. */
19
    public static final XYCoordinateType INDEX 
16
    public static final 
20
  
17
DateTickMarkPosition END
21
          = new XYCoordinateType("XYCoordinateType.INDEX");
18
        = new 
19
DateTickMarkPosition("DateTickMarkPosition.END");
20

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

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

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

40
    /**
42
    /**
41
     * Returns <code>true</code> if this object is equal to the specified 
43
     * Returns <code>true</code> if this object is equal to the specified 
42
     * object, and <code>false</code> otherwise.
44
     * object, and <code>false</code> otherwise.
43
     *
45
     *
44
     * @param obj  the other object.
46
     * @param obj  the other object.
45
     *
47
     *
46
     * @return A boolean.
48
     * @return A boolean.
47
     */
49
     */
48
    public boolean equals(Object obj) {
50
    public boolean equals(Object obj) {
51

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

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