Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00018 package com.generalrobotix.ui.util;
00019
00020 import java.lang.System;
00021
00022 public class GrxCopyUtil {
00023 public static int[][] copyIntWDim(int[][] src ){
00024 int [][] ret = new int[src.length][];
00025 for(int i = 0; i < src.length; ++i){
00026 ret[i] = new int[src[i].length];
00027 GrxCopyUtil.copyDim(src[i], ret[i], src[i].length);
00028 }
00029 return ret;
00030 }
00031
00032 public static long[][] copyLongWDim(long[][] src ){
00033 long [][] ret = new long[src.length][];
00034 for(int i = 0; i < src.length; ++i){
00035 ret[i] = new long[src[i].length];
00036 GrxCopyUtil.copyDim(src[i], ret[i], src[i].length);
00037 }
00038 return ret;
00039 }
00040
00041 public static double[][] copyDoubleWDim(double[][] src ){
00042 double [][] ret = new double[src.length][];
00043 for(int i = 0; i < src.length; ++i){
00044 ret[i] = new double[src[i].length];
00045 GrxCopyUtil.copyDim(src[i], ret[i], src[i].length);
00046 }
00047 return ret;
00048 }
00049
00050 public static float[][] copyFloatWDim(float[][] src ){
00051 float [][] ret = new float[src.length][];
00052 for(int i = 0; i < src.length; ++i){
00053 ret[i] = new float[src[i].length];
00054 GrxCopyUtil.copyDim(src[i], ret[i], src[i].length);
00055 }
00056 return ret;
00057 }
00058
00059 public static <T> void copyDim(T src, T dest, int length){
00060 System.arraycopy(src, 0, dest, 0, length);
00061 }
00062 }