Java Array Empty Check isEmpty(int[] array)

Here you can find the source of isEmpty(int[] array)

Description

is Empty

License

Apache License

Declaration

public static boolean isEmpty(int[] array) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Collection;

import java.util.Map;

public class Main {

    public static boolean isEmpty(Collection<?> col) {
        if (col == null || col.size() == 0) {
            return true;
        } else {/* ww  w .  j  a va2 s.  c  o  m*/
            return false;
        }
    }

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

    public static boolean isEmpty(int[] array) {
        if (array == null || array.length == 0) {
            return true;
        }
        return false;
    }

    public static boolean isEmpty(double[] array) {
        if (array == null || array.length == 0) {
            return true;
        }
        return false;
    }

    public static boolean isEmpty(byte[] array) {
        if (array == null || array.length == 0) {
            return true;
        } else {
            return false;
        }
    }

    public static boolean isEmpty(Map<?, ?> map) {
        if (map == null || map.size() == 0) {
            return true;
        } else {
            return false;
        }
    }
}

Related

  1. isEmpty(byte[] array)
  2. isEmpty(E[] array)
  3. isEmpty(final int[] arr)
  4. isEmpty(final Object[] array)
  5. isEmpty(final X[] array)
  6. isEmpty(int[] array)
  7. isEmpty(Object[] args)
  8. isEmpty(Object[] arr)
  9. isEmpty(Object[] array)