Android Utililty Methods Array Contains

List of utility methods to do Array Contains

Description

The list of methods to do Array Contains are organized into topic(s).

Method

booleancontains(Object[] array, Object objectToFind)

Checks if the object is in the given array.

The method returns false if a null array is passed in.

return indexOf(array, objectToFind) != INDEX_NOT_FOUND;
booleancontains(T[] array, T e)
contains
return indexOf(e, array) != -1;
booleancontains(T[] array, T value)
Checks that value is present as at least one of the elements of the array.
for (T element : array) {
    if (element == null) {
        if (value == null)
            return true;
    } else {
        if (value != null && element.equals(value))
            return true;
return false;
booleancontains(T[] array, T value)
Checks that value is present as at least one of the elements of the array.
for (T element : array) {
    if (element == null) {
        if (value == null)
            return true;
    } else {
        if (value != null && element.equals(value))
            return true;
return false;
booleancontains(T[] array, T value)
Checks that value is present as at least one of the elements of the array.
for (T element : array) {
    if (element == null) {
        if (value == null)
            return true;
    } else {
        if (value != null && element.equals(value))
            return true;
return false;
booleancontains(T[] array, T value)
contains
for (T element : array) {
    if (element == null) {
        if (value == null) {
            return true;
    } else {
        if (value != null && element.equals(value)) {
            return true;
...
booleancontains(boolean[] array, boolean valueToFind)

Checks if the value is in the given array.

The method returns false if a null array is passed in.

return indexOf(array, valueToFind) != INDEX_NOT_FOUND;
booleancontains(byte[] array, byte valueToFind)

Checks if the value is in the given array.

The method returns false if a null array is passed in.

return indexOf(array, valueToFind) != INDEX_NOT_FOUND;
booleancontains(char[] array, char valueToFind)

Checks if the value is in the given array.

The method returns false if a null array is passed in.

return indexOf(array, valueToFind) != INDEX_NOT_FOUND;
booleancontains(double[] array, double valueToFind)

Checks if the value is in the given array.

The method returns false if a null array is passed in.

return indexOf(array, valueToFind) != INDEX_NOT_FOUND;