Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.ArrayList;
import java.util.Map;
import android.util.SparseArray;

public class Main {
    public static boolean isNotEmpty(ArrayList<?> arrayList) {
        return !isEmpty(arrayList);
    }

    public static boolean isNotEmpty(Map<?, ?> map) {
        return !isEmpty(map);
    }

    public static boolean isNotEmpty(Object[] objects) {
        return !isEmpty(objects);
    }

    public static boolean isNotEmpty(SparseArray sparseArray) {
        return !isEmpty(sparseArray);
    }

    public static boolean isEmpty(ArrayList<?> arrayList) {
        return arrayList == null || arrayList.isEmpty();
    }

    public static boolean isEmpty(Map<?, ?> map) {
        return map == null || map.keySet().isEmpty();
    }

    public static boolean isEmpty(Object[] objects) {
        return objects == null || objects.length <= 0;
    }

    public static boolean isEmpty(SparseArray sparseArray) {
        return sparseArray == null || sparseArray.size() <= 0;
    }
}