Example usage for org.jfree.chart.util ObjectUtilities deepClone

List of usage examples for org.jfree.chart.util ObjectUtilities deepClone

Introduction

In this page you can find the example usage for org.jfree.chart.util ObjectUtilities deepClone.

Prototype

public static Collection deepClone(final Collection collection) throws CloneNotSupportedException 

Source Link

Document

Returns a new collection containing clones of all the items in the specified collection.

Usage

From source file:org.jfree.data.DefaultKeyedValues2D.java

/**
 * Returns a clone./*from ww  w  .ja  v  a2 s . co m*/
 * 
 * @return A clone.
 * 
 * @throws CloneNotSupportedException  this class will not throw this 
 *         exception, but subclasses (if any) might.
 */
public Object clone() throws CloneNotSupportedException {
    DefaultKeyedValues2D clone = (DefaultKeyedValues2D) super.clone();
    // for the keys, a shallow copy should be fine because keys
    // should be immutable...
    clone.columnKeys = new java.util.ArrayList(this.columnKeys);
    clone.rowKeys = new java.util.ArrayList(this.rowKeys);

    // but the row data requires a deep copy
    clone.rows = (List) ObjectUtilities.deepClone(this.rows);
    return clone;
}

From source file:org.jfree.data.xy.XYSeries.java

/**
 * Returns a clone of the series./*from   w  w w.j  ava  2s . co  m*/
 *
 * @return A clone of the series.
 *
 * @throws CloneNotSupportedException if there is a cloning problem.
 */
public Object clone() throws CloneNotSupportedException {
    XYSeries clone = (XYSeries) super.clone();
    clone.data = (List) ObjectUtilities.deepClone(this.data);
    return clone;
}

From source file:org.jfree.data.xy.XYSeries.java

/**
 * Returns a clone of the series./*from w ww  . jav  a 2  s.com*/
 *
 * @return A clone of the series.
 *
 * @throws CloneNotSupportedException if there is a cloning
 *                                    problem.
 */
public Object clone() throws CloneNotSupportedException {
    XYSeries clone = (XYSeries) super.clone();

    clone.data = (List) ObjectUtilities.deepClone(this.data);
    return clone;
}