CloneSet514


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
14230.965method_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
114273
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/data/ComparableObjectSeries.java
212595
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/data/xy/XYSeries.java
Next
Last
Clone Instance
1
Line Count
14
Source Line
273
Source File
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/data/ComparableObjectSeries.java

/**
 * Returns the index of the item with the specified x-value, or a negative 
 * index if the series does not contain an item with that x-value.  Be 
 * aware that for an unsorted series, the index is found by iterating 
 * through all items in the series.
 * 
 * @param x  the x-value (<code>null</code> not permitted).
 * 
 * @return The index.
 */
public int indexOf(Comparable x) {
  if (this.autoSort) {
    return Collections.binarySearch(this.data, new ComparableObjectItem(x, null));
  }
  else {
    for (int i = 0; i < this.data.size(); i++) {
      ComparableObjectItem item = (ComparableObjectItem) this.data.get(i);
      if (item.getComparable().equals(x)) {
        return i;
      }
    }
    return -1;
  }
}


First
Previous
Clone Instance
2
Line Count
12
Source Line
595
Source File
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/data/xy/XYSeries.java

/**
 * Returns the index of the item with the specified x-value, or a negative
 * index if the series does not contain an item with that x-value.  Be
 * aware that for an unsorted series, the index is found by iterating
 * through all items in the series.
 *
 * @param x  the x-value (<code>null</code> not permitted).
 *
 * @return The index.
 */
public int indexOf(Number x) {
  if (this.autoSort) {
    return Collections.binarySearch(this.data, new XYDataItem(x, null));
  }
  else {
    for (int i = 0; i < this.data.size(); i++) {
      XYDataItem item = (XYDataItem) this.data.get(i);
      if (item.getX().equals(x)) {
        return i;
      }
    }
    return -1;
  }
}


Clone AbstractionParameter Count: 3Parameter Bindings

/**
     * Returns the index of the item with the specified x-value, or a negative 
     * index if the series does not contain an item with that x-value.  Be 
     * aware that for an unsorted series, the index is found by iterating 
     * through all items in the series.
     * 
     * @param x  the x-value (<code>null</code> not permitted).
     * 
     * @return The index.
     */
/**
     * Returns the index of the item with the specified x-value, or a negative
     * index if the series does not contain an item with that x-value.  Be
     * aware that for an unsorted series, the index is found by iterating
     * through all items in the series.
     *
     * @param x  the x-value (<code>null</code> not permitted).
     *
     * @return The index.
     */
public int indexOf( [[#variable18c111a0]] x) {
  if (this.autoSort) {
    return Collections.binarySearch(this.data, new [[#variable18c11120]](x, null));
  }
  else {
    for (int i = 0; i < this.data.size(); i++) {
       [[#variable18c11120]] item = ( [[#variable18c11120]]) this.data.get(i);
      if (item. [[#variable18c11020]]().equals(x)) {
        return i;
      }
    }
    return -1;
  }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#18c111a0]]
Comparable 
12[[#18c111a0]]
Number 
21[[#18c11120]]
ComparableObjectItem 
22[[#18c11120]]
XYDataItem 
31[[#18c11020]]
getComparable 
32[[#18c11020]]
getX