A clone of an array list one level deeper than a shallow clone. The clone() method of the objects in the list must be accessible
(ArrayList src)
| 4938 | /** A clone of an array list one level deeper than a shallow clone. |
| 4939 | * The clone() method of the objects in the list must be accessible */ |
| 4940 | private ArrayList cloneArrayList(ArrayList src) { |
| 4941 | ArrayList dest = (ArrayList)(src.clone()); //shallow clone |
| 4942 | Class[] noClasses = new Class[0]; |
| 4943 | Object[] noObjects = new Object[0]; |
| 4944 | for (int i=0; i<dest.size(); i++) { |
| 4945 | Object o = dest.get(i); |
| 4946 | if (o != null) try { |
| 4947 | Method cloneMethod = o.getClass().getMethod("clone", noClasses); |
| 4948 | dest.set(i, cloneMethod.invoke(o, noObjects)); |
| 4949 | } catch (Exception e) {} |
| 4950 | } |
| 4951 | return dest; |
| 4952 | } |
| 4953 | |
| 4954 | /** Converts old (pre-1.52i) type codes for the PlotObjects to the new ones, which can be used as masks */ |
| 4955 | void updateType() { |