Here you can find the source of clone_obj_array(Object source)
public static Object clone_obj_array(Object source)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 Jay Unruh, Stowers Institute for Medical Research. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v2.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html ******************************************************************************/ public class Main { public static Object clone_obj_array(Object source) { if (source instanceof float[]) { return ((float[]) source).clone(); } else {/*from w w w . j a v a 2 s.c om*/ if (source instanceof short[]) { return ((short[]) source).clone(); } else { if (source instanceof byte[]) { return ((byte[]) source).clone(); } else { if (source instanceof short[]) return ((short[]) source).clone(); else return ((int[]) source).clone(); } } } } public static Object[] clone_obj_array(Object[] source) { Object[] cloned = new Object[source.length]; for (int i = 0; i < source.length; i++) cloned[i] = clone_obj_array(source[i]); return cloned; } public static Object[][] clone_obj_array(Object[][] source) { Object[][] cloned = new Object[source.length][]; for (int i = 0; i < source.length; i++) cloned[i] = clone_obj_array(source[i]); return cloned; } }