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