Java Array Fill fillColor(int[][] dist)

Here you can find the source of fillColor(int[][] dist)

Description

fill Color

License

Open Source License

Declaration

public static void fillColor(int[][] dist) 

Method Source Code

//package com.java2s;
/* ArrayUtil.java 1.0 2010-2-2
 * //from   w w  w .  j a  va2 s.co m
 * Copyright (c) 2010 by Chen Zhiwu
 * All rights reserved.
 * 
 * The copyright of this software is own by the authors.
 * You may not use, copy or modify this software, except
 * in accordance with the license agreement you entered into 
 * with the copyright holders. For details see accompanying license
 * terms.
 */

import java.util.Arrays;

public class Main {
    public static void fillColor(int[][] dist) {
        int white = 0xff << 24;
        for (int i = 0; i < dist.length; i++) {
            Arrays.fill(dist[i], white);
        }
    }

    public static void fillColor(int[][] dist, int color) {
        for (int i = 0; i < dist.length; i++) {
            Arrays.fill(dist[i], color);
        }
    }
}

Related

  1. fillArray(T[] arr, T val)
  2. fillArray2D(double[][] arr, double value)
  3. fillArrayWith(byte[] dest, byte[] pattern)
  4. fillArrayWithByte(byte[] array, byte value)
  5. fillArrayWithHalfSorted(int[] nums)
  6. filledIntArray(int length, int cont)