CloneSet46


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
137230.984class_body_declarations[9]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
113558
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/urls/CustomCategoryURLGenerator.java
213767
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/urls/CustomXYURLGenerator.java
Next
Last
Clone Instance
1
Line Count
135
Source Line
58
Source File
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/urls/CustomCategoryURLGenerator.java

/** Storage for the URLs. */
private ArrayList urlSeries = new ArrayList();

/**
 * Default constructor.
 */
public CustomCategoryURLGenerator() {
  super();
}

/**
 * Returns the number of URL lists stored by the renderer.
 *
 * @return The list count.
 */
public int getListCount() {
  return this.urlSeries.size();
}

/**
 * Returns the number of URLs in a given list.
 *
 * @param list  the list index (zero based).
 *
 * @return The URL count.
 */
public int getURLCount(int list) {
  int result = 0;
  List urls = (List) this.urlSeries.get(list);
  if (urls != null) {
    result = urls.size();
  }
  return result;
}

/**
 * Returns the URL for an item.
 *
 * @param series  the series index.
 * @param item  the item index.
 *
 * @return The URL (possibly <code>null</code>).
 */
public String getURL(int series, int item) {
  String result = null;
  if (series < getListCount()) {
    List urls = (List) this.urlSeries.get(series);
    if (urls != null) {
      if (item < urls.size()) {
        result = (String) urls.get(item);
      }
    }
  }
  return result;
}

/**
 * Generates a URL.
 *
 * @param dataset  the dataset (ignored in this implementation).
 * @param series  the series (zero-based index).
 * @param item  the item (zero-based index).
 *
 * @return A string containing the URL (possibly <code>null</code>).
 */
public String generateURL(CategoryDataset dataset, int series, int item) {
  return getURL(series, item);
}

/**
 * Adds a list of URLs.
 *
 * @param urls  the list of URLs (<code>null</code> permitted).
 */
public void addURLSeries(List urls) {
  List listToAdd = null;
  if (urls != null) {
    listToAdd = new java.util.ArrayList(urls);
  }
  this.urlSeries.add(listToAdd);
}

/**
 * Tests if this object is equal to another.
 *
 * @param obj  the other object.
 *
 * @return A boolean.
 */
public boolean equals(Object obj) {
  if (obj == this ) {
    return true;
  }
  if ( !(obj instanceof CustomCategoryURLGenerator)) {
    return false;
  }
  CustomCategoryURLGenerator generator = (CustomCategoryURLGenerator) obj;
  int listCount = getListCount();
  if (listCount != generator.getListCount()) {
    return false;
  }
  for (int series = 0; series < listCount; series++) {
    int urlCount = getURLCount(series);
    if (urlCount != generator.getURLCount(series)) {
      return false;
    }
    for (int item = 0; item < urlCount; item++) {
      String u1 = getURL(series, item);
      String u2 = generator.getURL(series, item);
      if (u1 != null) {
        if ( !u1.equals(u2)) {
          return false;
        }
      }
      else {
        if (u2 != null) {
          return false;
        }
      }
    }
  }
  return true;
}

/**
 * Returns a new generator that is a copy of, and independent from, this
 * generator.
 *
 * @return A clone.
 */
public Object clone() throws CloneNotSupportedException {
  CustomCategoryURLGenerator clone = (CustomCategoryURLGenerator) super.clone();
  clone.urlSeries = new java.util.ArrayList(this.urlSeries);
  return clone;
}


First
Previous
Clone Instance
2
Line Count
137
Source Line
67
Source File
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/urls/CustomXYURLGenerator.java

/** Storage for the URLs. */
private ArrayList urlSeries = new ArrayList();

/**
 * Default constructor.
 */
public CustomXYURLGenerator() {
  super();
}

/**
 * Returns the number of URL lists stored by the renderer.
 *
 * @return The list count.
 */
public int getListCount() {
  return this.urlSeries.size();
}

/**
 * Returns the number of URLs in a given list.
 *
 * @param list  the list index (zero based).
 *
 * @return The URL count.
 */
public int getURLCount(int list) {
  int result = 0;
  List urls = (List) this.urlSeries.get(list);
  if (urls != null) {
    result = urls.size();
  }
  return result;
}

/**
 * Returns the URL for an item.
 *
 * @param series  the series index.
 * @param item  the item index.
 *
 * @return The URL (possibly <code>null</code>).
 */
public String getURL(int series, int item) {
  String result = null;
  if (series < getListCount()) {
    List urls = (List) this.urlSeries.get(series);
    if (urls != null) {
      if (item < urls.size()) {
        result = (String) urls.get(item);
      }
    }
  }
  return result;
}

/**
 * Generates a URL.
 *
 * @param dataset  the dataset.
 * @param series  the series (zero-based index).
 * @param item  the item (zero-based index).
 *
 * @return A string containing the URL (possibly <code>null</code>).
 */
public String generateURL(XYDataset dataset, int series, int item) {
  return getURL(series, item);
}

/**
 * Adds a list of URLs.
 *
 * @param urls  the list of URLs (<code>null</code> permitted, the list
 *     is copied).
 */
public void addURLSeries(List urls) {
  List listToAdd = null;
  if (urls != null) {
    listToAdd = new java.util.ArrayList(urls);
  }
  this.urlSeries.add(listToAdd);
}

/**
 * Tests this generator for equality with an arbitrary object.
 *
 * @param obj  the object (<code>null</code> permitted).
 *
 * @return A boolean.
 */
public boolean equals(Object obj) {
  if (obj == this ) {
    return true;
  }
  if ( !(obj instanceof CustomXYURLGenerator)) {
    return false;
  }
  CustomXYURLGenerator that = (CustomXYURLGenerator) obj;
  int listCount = getListCount();
  if (listCount != that.getListCount()) {
    return false;
  }
  for (int series = 0; series < listCount; series++) {
    int urlCount = getURLCount(series);
    if (urlCount != that.getURLCount(series)) {
      return false;
    }
    for (int item = 0; item < urlCount; item++) {
      String u1 = getURL(series, item);
      String u2 = that.getURL(series, item);
      if (u1 != null) {
        if ( !u1.equals(u2)) {
          return false;
        }
      }
      else {
        if (u2 != null) {
          return false;
        }
      }
    }
  }
  return true;
}

/**
 * Returns a new generator that is a copy of, and independent from, this
 * generator.
 *
 * @return A clone.
 */
public Object clone() throws CloneNotSupportedException {
  CustomXYURLGenerator clone = (CustomXYURLGenerator) super.clone();
  clone.urlSeries = new java.util.ArrayList(this.urlSeries);
  return clone;
}


Clone AbstractionParameter Count: 3Parameter Bindings

/** Storage for the URLs. */
private ArrayList urlSeries = new ArrayList();

/**
     * Default constructor.
     */
public [[#variable15096760]]() {
  super();
}

/**
     * Returns the number of URL lists stored by the renderer.
     *
     * @return The list count.
     */
public int getListCount() {
  return this.urlSeries.size();
}

/**
     * Returns the number of URLs in a given list.
     *
     * @param list  the list index (zero based).
     *
     * @return The URL count.
     */
public int getURLCount(int list) {
  int result = 0;
  List urls = (List) this.urlSeries.get(list);
  if (urls != null) {
    result = urls.size();
  }
  return result;
}

/**
     * Returns the URL for an item.
     *
     * @param series  the series index.
     * @param item  the item index.
     *
     * @return The URL (possibly <code>null</code>).
     */
public String getURL(int series, int item) {
  String result = null;
  if (series < getListCount()) {
    List urls = (List) this.urlSeries.get(series);
    if (urls != null) {
      if (item < urls.size()) {
        result = (String) urls.get(item);
      }
    }
  }
  return result;
}

/**
     * Generates a URL.
     *
     * @param dataset  the dataset.
     * @param series  the series (zero-based index).
     * @param item  the item (zero-based index).
     *
     * @return A string containing the URL (possibly <code>null</code>).
     */
/**
     * Generates a URL.
     *
     * @param dataset  the dataset (ignored in this implementation).
     * @param series  the series (zero-based index).
     * @param item  the item (zero-based index).
     *
     * @return A string containing the URL (possibly <code>null</code>).
     */
public String generateURL( [[#variable150966a0]] dataset, int series, int item) {
  return getURL(series, item);
}

/**
     * Adds a list of URLs.
     *
     * @param urls  the list of URLs (<code>null</code> permitted, the list
     *     is copied).
     */
/**
     * Adds a list of URLs.
     *
     * @param urls  the list of URLs (<code>null</code> permitted).
     */
public void addURLSeries(List urls) {
  List listToAdd = null;
  if (urls != null) {
    listToAdd = new java.util.ArrayList(urls);
  }
  this.urlSeries.add(listToAdd);
}

/**
     * Tests this generator for equality with an arbitrary object.
     *
     * @param obj  the object (<code>null</code> permitted).
     *
     * @return A boolean.
     */
/**
     * Tests if this object is equal to another.
     *
     * @param obj  the other object.
     *
     * @return A boolean.
     */
public boolean equals(Object obj) {
  if (obj == this ) {
    return true;
  }
  if ( !(obj instanceof [[#variable15096760]])) {
    return false;
  }
   [[#variable15096760]]  [[#variable15096600]]= ( [[#variable15096760]]) obj;
  int listCount = getListCount();
  if (listCount != [[#variable15096600]].getListCount()) {
    return false;
  }
  for (int series = 0; series < listCount; series++) {
    int urlCount = getURLCount(series);
    if (urlCount != [[#variable15096600]].getURLCount(series)) {
      return false;
    }
    for (int item = 0; item < urlCount; item++) {
      String u1 = getURL(series, item);
      String u2 = [[#variable15096600]].getURL(series, item);
      if (u1 != null) {
        if ( !u1.equals(u2)) {
          return false;
        }
      }
      else {
        if (u2 != null) {
          return false;
        }
      }
    }
  }
  return true;
}

/**
     * Returns a new generator that is a copy of, and independent from, this
     * generator.
     *
     * @return A clone.
     */
public Object clone() throws CloneNotSupportedException {
   [[#variable15096760]] clone = ( [[#variable15096760]]) super.clone();
  clone.urlSeries = new java.util.ArrayList(this.urlSeries);
  return clone;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#15096760]]
CustomCategoryURLGenerator 
12[[#15096760]]
CustomXYURLGenerator 
21[[#150966a0]]
CategoryDataset 
22[[#150966a0]]
XYDataset 
31[[#15096600]]
generator 
32[[#15096600]]
that