Java tutorial
//package com.java2s; /** * Copyright 2004-2006 DFKI GmbH. * All Rights Reserved. Use is subject to license terms. * <p/> * This file is part of MARY TTS. * <p/> * MARY TTS is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, version 3 of the License. * <p/> * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * <p/> * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ public class Main { /** * Returns the vector [x y] * * @deprecated use {@link org.apache.commons.lang.ArrayUtils.addAll} instead */ @Deprecated public static float[] combine(float[] x, float[] y) { int len = 0; if (x != null) len += x.length; if (y != null) len += y.length; float[] z = null; if (len > 0) { z = new float[len]; int currentPos = 0; if (x != null) { System.arraycopy(x, 0, z, currentPos, x.length); currentPos = x.length; } if (y != null) System.arraycopy(y, 0, z, currentPos, y.length); } return z; } /** * Returns the vector [x y] * * @deprecated use {@link org.apache.commons.lang.ArrayUtils.addAll} instead */ @Deprecated public static double[] combine(double[] x, double[] y) { int len = 0; if (x != null) len += x.length; if (y != null) len += y.length; double[] z = null; if (len > 0) { z = new double[len]; int currentPos = 0; if (x != null) { System.arraycopy(x, 0, z, currentPos, x.length); currentPos = x.length; } if (y != null) System.arraycopy(y, 0, z, currentPos, y.length); } return z; } }