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 DomainOrder implements Serializable { /** For serialization. */ private static final long serialVersionUID = 4902774943512072627L; /** No order. */ public static final DomainOrder NONE = new DomainOrder("DomainOrder.NONE"); /** Ascending order. */ public static final DomainOrder ASCENDING = new DomainOrder("DomainOrder.ASCENDING"); /** Descending order. */ public static final DomainOrder DESCENDING = new DomainOrder("DomainOrder.DESCENDING"); /** The name. */ private String name; /** * Private constructor. * * @param name the name. */ private DomainOrder(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 DomainOrder)) { return false; } DomainOrder that = (DomainOrder) 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(DomainOrder.ASCENDING)) { return DomainOrder.ASCENDING; } else if (this.equals(DomainOrder.DESCENDING)) { return DomainOrder.DESCENDING; } else if (this.equals(DomainOrder.NONE)) { return DomainOrder.NONE; } 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/data/DomainOrder.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 DomainOrder implements Serializable {
2
    /** For serialization. */
2
    /** For serialization. */
3
    private static final long serialVersionUID = 2540750672764537240L;
3
    private static final long serialVersionUID = 4902774943512072627L;
4
    
4
    
5
    /** Start of period. */
5
    /** No order. */
6
    public static final DateTickMarkPosition START
6
    public static final D
7
        = new DateTickMarkPosition("DateTickMarkPosition.START");
8
    /** Middle of period
7
omainOrder NONE = new DomainOrder("DomainOrder.NONE");
9
. */
8
    /** Ascending order. */
10
    public static final DateTickMarkPosition MIDDLE
9
    public static final D
11
        = new DateTickMarkPosition("DateTickMarkPosition.MIDDLE");
12
    /** End of period
10
omainOrder ASCENDING 
11
        = new DomainOrder("DomainOrder.ASCENDING");
13
. */
12
    /** Descending order. */
14
    public static final DateTickMarkPosition END
13
    public static final D
15
        = new DateTickMarkPosition("DateTickMarkPosition.END
14
omainOrder DESCENDING 
16
");
15
        = new DomainOrder("DomainOrder.DESCENDING");
17
    /** The name. */
16
    /** The name. */
18
    private String name;
17
    private String name;
19
    /**
18
    /**
20
     * Private constructor.
19
     * Private constructor.
21
     *
20
     *
22
     * @param name  the name.
21
     * @param name  the name.
23
     */
22
     */
24
    private DateTickMarkPosition(String name) {
23
    private DomainOrder(String name) {
25
        this.name = name;
24
        this.name = name;
26
    }
25
    }
27
    /**
26
    /**
28
     * Returns a string representing the object.
27
     * Returns a string representing the object.
29
     *
28
     *
30
     * @return The string.
29
     * @return The string.
31
     */
30
     */
32
    public String toString() {
31
    public String toString() {
33
        return this.name;
32
        return this.name;
34
    }
33
    }
35
    /**
34
    /**
36
     * Returns <code>true</code> if this object is equal to the specified 
35
     * Returns <code>true</code> if this object is equal to the specified 
37
     * object, and <code>false</code> otherwise.
36
     * object, and <code>false</code> otherwise.
38
     *
37
     *
39
     * @param obj  the other object.
38
     * @param obj  the other object.
40
     *
39
     *
41
     * @return A boolean.
40
     * @return A boolean.
42
     */
41
     */
43
    public boolean equals(Object obj) {
42
    public boolean equals(Object obj) {
44
        if (this == obj) {
43
        if (this == obj) {
45
            return true;
44
            return true;
46
        }
45
        }
47
        if (!(obj instanceof DateTickMarkPosition)) {
46
        if (!(obj instanceof DomainOrder)) {
48
            return false;
47
            return false;
49
        }
48
        }
50
        DateTickMarkPosition position = (DateTickMarkPosition) obj;
49
        DomainOrder that = (DomainOrder) obj;
51
        if (!this.name.equals(position.toString())) {
50
        if (!this.name.equals(that.toString())) {
52
            return false;
51
            return false;
53
        }
52
        }
54
        return true;
53
        return true;
54
    }
55
    }
55
    
56
    
56
    /**
57
     * Returns a hash code value for the object.
58
     *
59
     * @return The hashcode
60
     */
61
    public int hashCode() {
62
        return this.name.hashCode();
63
    }
57
    /**
64
    /**
58
     * Ensures that serialization returns the unique instances.
65
     * Ensures that serialization returns the unique instances.
59
     * 
66
     * 
60
     * @return The object.
67
     * @return The object.
61
     * 
68
     * 
62
     * @throws ObjectStreamException if there is a problem.
69
     * @throws ObjectStreamException if there is a problem.
63
     */
70
     */
64
    private Object readResolve() throws ObjectStreamException {
71
    private Object readResolve() throws ObjectStreamException {
65
        if (this.equals(DateTickMarkPosition.START)) {
72
        if (this.equals(DomainOrder.ASCENDING)) {
66
            return DateTickMarkPosition.START;
73
            return DomainOrder.ASCENDING;
67
        }
74
        }
68
        else if (this.equals(DateTickMarkPosition.MIDDLE)) {
75
        else if (this.equals(D
69
            return DateTickMarkPosition.MIDDLE
76
omainOrder.DESCENDING)) {
70
;
77
            return DomainOrder.DESCENDING;
71
        }    
78
        }
72
        else if (this.equals(DateTickMarkPosition.END)) {
79
        else if (this.equals(DomainOrder.NONE)) {
73
            return DateTickMarkPosition.END;
80
            return DomainOrder.NONE;
74
        }    
81
        }
75
        return null
82
        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