public final class DatasetRenderingOrder implements Serializable { /** For serialization. */ private static final long serialVersionUID = -600593412366385072L; /** * Render datasets in the order 0, 1, 2, ..., N-1, where N is the number * of datasets. */ public static final DatasetRenderingOrder FORWARD = new DatasetRenderingOrder("DatasetRenderingOrder.FORWARD"); /** * Render datasets in the order N-1, N-2, ..., 2, 1, 0, where N is the * number of datasets. */ public static final DatasetRenderingOrder REVERSE = new DatasetRenderingOrder("DatasetRenderingOrder.REVERSE"); /** The name. */ private String name; /** * Private constructor. * * @param name the name. */ private DatasetRenderingOrder(String name) { this.name = name; } /** * Returns a string representing the object. * * @return The string (never <code>null</code>). */ 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 DatasetRenderingOrder)) { return false; } DatasetRenderingOrder order = (DatasetRenderingOrder) obj; if (!this.name.equals(order.toString())) { return false; } return true; } /** * Returns a hash code for this instance. * * @return A hash code. */ 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(DatasetRenderingOrder.FORWARD)) { return DatasetRenderingOrder.FORWARD; } else if (this.equals(DatasetRenderingOrder.REVERSE)) { return DatasetRenderingOrder.REVERSE; } return null
public final class SeriesRenderingOrder implements Serializable { /** For serialization. */ private static final long serialVersionUID = 209336477448807735L; /** * Render series in the order 0, 1, 2, ..., N-1, where N is the number * of series. */ public static final SeriesRenderingOrder FORWARD = new SeriesRenderingOrder("SeriesRenderingOrder.FORWARD"); /** * Render series in the order N-1, N-2, ..., 2, 1, 0, where N is the * number of series. */ public static final SeriesRenderingOrder REVERSE = new SeriesRenderingOrder("SeriesRenderingOrder.REVERSE"); /** The name. */ private String name; /** * Private constructor. * * @param name the name. */ private SeriesRenderingOrder(String name) { this.name = name; } /** * Returns a string representing the object. * * @return The string (never <code>null</code>). */ 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 SeriesRenderingOrder)) { return false; } SeriesRenderingOrder order = (SeriesRenderingOrder) obj; if (!this.name.equals(order.toString())) { return false; } return true; } /** * Returns a hash code for this instance. * * @return A hash code. */ 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(SeriesRenderingOrder.FORWARD)) { return SeriesRenderingOrder.FORWARD; } else if (this.equals(SeriesRenderingOrder.REVERSE)) { return SeriesRenderingOrder.REVERSE; } return null
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/DatasetRenderingOrder.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/SeriesRenderingOrder.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public final class DatasetRenderingOrder implements Serializable {
1
public final class SeriesRenderingOrder implements Serializable {
2
    /** For serialization. */
2
    /** For serialization. */
3
    private static final long serialVersionUID = -600593412366385072L;
3
    private static final long serialVersionUID = 209336477448807735L;
4
    
4
    
5
    /** 
5
    /**
6
     * Render datasets in the order 0, 1, 2, ..., N-1, where N is the number 
6
     * Render series in the order 0, 1, 2, ..., N-1, where N is the number
7
     * of datasets. 
7
     * of series.
8
     */
8
     */
9
    public static final DatasetRenderingOrder FORWARD
9
    public static final SeriesRenderingOrder FORWARD
10
            = new DatasetRenderingOrder("DatasetRenderingOrder.FORWARD");
10
            = new SeriesRenderingOrder("SeriesRenderingOrder.FORWARD");
11
    /** 
11
    /**
12
     * Render datasets in the order N-1, N-2, ..., 2, 1, 0, where N is the 
12
     * Render series in the order N-1, N-2, ..., 2, 1, 0, where N is the
13
     * number of datasets. 
13
     * number of series.
14
     */
14
     */
15
    public static final DatasetRenderingOrder REVERSE
15
    public static final SeriesRenderingOrder REVERSE
16
            = new DatasetRenderingOrder("DatasetRenderingOrder.REVERSE");
16
            = new SeriesRenderingOrder("SeriesRenderingOrder.REVERSE");
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 DatasetRenderingOrder(String name) {
24
    private SeriesRenderingOrder(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 (never <code>null</code>).
30
     * @return The string (never <code>null</code>).
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 object (<code>null</code> permitted).
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 DatasetRenderingOrder)) {
47
        if (!(obj instanceof SeriesRenderingOrder)) {
48
            return false;
48
            return false;
49
        }
49
        }
50
        DatasetRenderingOrder order = (DatasetRenderingOrder) obj;
50
        SeriesRenderingOrder order = (SeriesRenderingOrder) obj;
51
        if (!this.name.equals(order.toString())) {
51
        if (!this.name.equals(order.toString())) {
52
            return false;
52
            return false;
53
        }
53
        }
54
        return true;
54
        return true;
55
    }
55
    }
56
    
57
    /**
56
    /**
58
     * Returns a hash code for this instance.
57
     * Returns a hash code for this instance.
59
     * 
58
     * 
60
     * @return A hash code.
59
     * @return A hash code.
61
     */
60
     */
62
    public int hashCode() {
61
    public int hashCode() {
63
        return this.name.hashCode();
62
        return this.name.hashCode();
64
    }
63
    }
65
    
64
    
66
    /**
65
    /**
67
     * Ensures that serialization returns the unique instances.
66
     * Ensures that serialization returns the unique instances.
68
     * 
67
     *
69
     * @return The object.
68
     * @return The object.
70
     * 
69
     *
71
     * @throws ObjectStreamException if there is a problem.
70
     * @throws ObjectStreamException if there is a problem.
72
     */
71
     */
73
    private Object readResolve() throws ObjectStreamException {
72
    private Object readResolve() throws ObjectStreamException {
74
        if (this.equals(DatasetRenderingOrder.FORWARD)) {
73
        if (this.equals(SeriesRenderingOrder.FORWARD)) {
75
            return DatasetRenderingOrder.FORWARD;
74
            return SeriesRenderingOrder.FORWARD;
76
        }
75
        }
77
        else if (this.equals(DatasetRenderingOrder.REVERSE)) {
76
        else if (this.equals(SeriesRenderingOrder.REVERSE)) {
78
            return DatasetRenderingOrder.REVERSE;
77
            return SeriesRenderingOrder.REVERSE;
79
        }      
78
        }
80
        return null
79
        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