Java Array Fill fill(String[] ary, String value)

Here you can find the source of fill(String[] ary, String value)

Description

fill

License

Open Source License

Declaration

public static void fill(String[] ary, String value) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Collection;

public class Main {
    public static void fill(String[] ary, String value) {
        if (!isEmplyOrNull(ary)) {
            for (int i = 0; i < ary.length; i++) {
                ary[i] = value;/* www  .  j  a v  a  2  s. com*/
            }
        }
    }

    public static <T> boolean isEmplyOrNull(T[] ary) {
        if (ary == null || ary.length == 0) {
            return true;
        }
        return false;
    }

    public static <T> boolean isEmplyOrNull(Collection<T> collection) {
        if (collection == null || collection.size() <= 0) {
            return true;
        }
        return false;
    }
}

Related

  1. fill(final double[][] arr, final double val)
  2. fill(final Object[] array, final int start, final int end, final Object value)
  3. fill(final T[] array, final int size)
  4. fill(final T[] array, final T value)
  5. fill(int[][] array, int value)
  6. fill(T[][][] arr, T val)
  7. fillArray(byte[] btArray, byte[] btValue, int iStartPosition, int iLength, byte btAlternateValue, int iAlign)
  8. fillArray(byte[] data)
  9. fillArray(char[] array, int offset, char value)