Java Array Contain arrayContains(final Object[] a, final Object v)

Here you can find the source of arrayContains(final Object[] a, final Object v)

Description

array Contains

License

Apache License

Declaration

public static boolean arrayContains(final Object[] a, final Object v) 

Method Source Code

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

public class Main {
    public static boolean arrayContains(final Object[] a, final Object v) {
        for (final Object x : a) {
            if (v == null) {
                if (x == null)
                    return true;
            } else {
                if (v.equals(x))
                    return true;
            }//from www.  ja v a 2  s. c  o  m
        }
        return false;
    }
}

Related

  1. arrayContains(char[] chars, char cToFind)
  2. arrayContains(char[] chars, char cToFind)
  3. arrayContains(final byte[] what, final byte[] b)
  4. arrayContains(final E[] arr, final E targetValue)
  5. arrayContains(final int[] array, final int v)
  6. arrayContains(final String[] array, String needle)
  7. arrayContains(final T[] array, final T v)
  8. arrayContains(int[] arr, int e)
  9. arrayContains(int[] arr, int ii)