Java Array Fill fillArray(double[][][] array, double[] value, int rows, int columns)

Here you can find the source of fillArray(double[][][] array, double[] value, int rows, int columns)

Description

Fill an array with translation values

License

Open Source License

Parameter

Parameter Description
array a parameter
value a parameter
rows a parameter
columns a parameter

Return

Filled array

Declaration

public static double[][][] fillArray(double[][][] array, double[] value, int rows, int columns) 

Method Source Code

//package com.java2s;
/*-/*from   www.j a v a 2 s.co m*/
 * Copyright 2015 Diamond Light Source Ltd.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */

public class Main {
    /**
     * Fill an array with translation values
     * 
     * @param array
     * @param value
     * @param rows
     * @param columns
     * @return Filled array
     */
    public static double[][][] fillArray(double[][][] array, double[] value, int rows, int columns) {
        array = new double[columns][rows][2];
        for (int i = 0; i < rows; i++) {
            for (int j = 0; j < columns; j++) {
                array[j][i] = value;
            }
        }
        return array;
    }
}

Related

  1. fill(String[] ary, String value)
  2. fill(T[][][] arr, T val)
  3. fillArray(byte[] btArray, byte[] btValue, int iStartPosition, int iLength, byte btAlternateValue, int iAlign)
  4. fillArray(byte[] data)
  5. fillArray(char[] array, int offset, char value)
  6. fillArray(final float[] array, final float value)
  7. fillArray(float filling, int length)
  8. fillArray(float[] batchVertices, float f)
  9. fillArray(int arrayLength)