Here you can find the source of coordinateSplit(Point2D.Double[] aPoints, double[] aX, double[] aY)
Parameter | Description |
---|---|
aPoints | Array of points from which coordinate values are to be read. |
aX | Array to store the values of the <i>x</i> coordinates of the points. The length of this array must be at least the length of <code>aPoints</code>. |
aY | Array to store the values of the <i>y</i> coordinates of the points. The length of this array must be at least the length of <code>aPoints</code>. |
Parameter | Description |
---|---|
ArrayIndexOutOfBoundsException | If the length of <code>aX</code> or of<code>aY</code> is smaller than the length of <code>aPoints</code>. |
NullPointerException | If any of the parameters is <code>null</code>. |
public static void coordinateSplit(Point2D.Double[] aPoints, double[] aX, double[] aY)
//package com.java2s; /*/* w ww .j a v a 2s.c o m*/ * #%L * Cytoscape NetworkAnalyzer Impl (network-analyzer-impl) * $Id:$ * $HeadURL:$ * %% * Copyright (C) 2006 - 2013 * Max Planck Institute for Informatics, Saarbruecken, Germany * The Cytoscape Consortium * %% * This program 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, either version 2.1 of the * License, or (at your option) any later version. * * 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 General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ import java.awt.geom.Point2D; public class Main { /** * Stores the coordinates of the given points in separate arrays. * * @param aPoints Array of points from which coordinate values are to be read. * @param aX Array to store the values of the <i>x</i> coordinates of the points. The length of * this array must be at least the length of <code>aPoints</code>. * @param aY Array to store the values of the <i>y</i> coordinates of the points. The length of * this array must be at least the length of <code>aPoints</code>. * * @throws ArrayIndexOutOfBoundsException If the length of <code>aX</code> or of * <code>aY</code> is smaller than the length of <code>aPoints</code>. * @throws NullPointerException If any of the parameters is <code>null</code>. */ public static void coordinateSplit(Point2D.Double[] aPoints, double[] aX, double[] aY) { final int count = aPoints.length; if (aX.length < count || aY.length < count) { throw new ArrayIndexOutOfBoundsException(count); } for (int i = 0; i < count; ++i) { final Point2D.Double point = aPoints[i]; aX[i] = point.x; aY[i] = point.y; } } }