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(double[] array, double valueToFind, double tolerance)

Checks if a value falling within the given tolerance is in the given array.

return indexOf(array, valueToFind, 0, tolerance) != INDEX_NOT_FOUND;
booleancontains(final byte[] pItems, final byte pItem)
contains
for (int i = pItems.length - 1; i >= 0; i--) {
    if (pItems[i] == pItem) {
        return true;
return false;
booleancontains(final char[] pItems, final char pItem)
contains
for (int i = pItems.length - 1; i >= 0; i--) {
    if (pItems[i] == pItem) {
        return true;
return false;
booleancontains(final double[] pItems, final double pItem)
contains
for (int i = pItems.length - 1; i >= 0; i--) {
    if (pItems[i] == pItem) {
        return true;
return false;
booleancontains(final float[] pItems, final float pItem)
contains
for (int i = pItems.length - 1; i >= 0; i--) {
    if (pItems[i] == pItem) {
        return true;
return false;
booleancontains(final int[] pItems, final int pItem)
contains
for (int i = pItems.length - 1; i >= 0; i--) {
    if (pItems[i] == pItem) {
        return true;
return false;
booleancontains(final long[] pItems, final long pItem)
contains
for (int i = pItems.length - 1; i >= 0; i--) {
    if (pItems[i] == pItem) {
        return true;
return false;
booleancontains(final short[] pItems, final short pItem)
contains
for (int i = pItems.length - 1; i >= 0; i--) {
    if (pItems[i] == pItem) {
        return true;
return false;
booleancontains(float[] array, float 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(int[] array, int value)
contains
for (int element : array) {
    if (element == value) {
        return true;
return false;