Android Array Contains contains(final byte[] pItems, final byte pItem)

Here you can find the source of contains(final byte[] pItems, final byte pItem)

Description

contains

Declaration

public static final boolean contains(final byte[] pItems,
            final byte pItem) 

Method Source Code

//package com.java2s;

public class Main {
    public static final boolean contains(final byte[] pItems,
            final byte pItem) {
        for (int i = pItems.length - 1; i >= 0; i--) {
            if (pItems[i] == pItem) {
                return true;
            }//  w  w w.j  ava2 s  .com
        }
        return false;
    }

    public static final boolean contains(final char[] pItems,
            final char pItem) {
        for (int i = pItems.length - 1; i >= 0; i--) {
            if (pItems[i] == pItem) {
                return true;
            }
        }
        return false;
    }

    public static final boolean contains(final short[] pItems,
            final short pItem) {
        for (int i = pItems.length - 1; i >= 0; i--) {
            if (pItems[i] == pItem) {
                return true;
            }
        }
        return false;
    }

    public static final boolean contains(final int[] pItems, final int pItem) {
        for (int i = pItems.length - 1; i >= 0; i--) {
            if (pItems[i] == pItem) {
                return true;
            }
        }
        return false;
    }

    public static final boolean contains(final long[] pItems,
            final long pItem) {
        for (int i = pItems.length - 1; i >= 0; i--) {
            if (pItems[i] == pItem) {
                return true;
            }
        }
        return false;
    }

    public static final boolean contains(final float[] pItems,
            final float pItem) {
        for (int i = pItems.length - 1; i >= 0; i--) {
            if (pItems[i] == pItem) {
                return true;
            }
        }
        return false;
    }

    public static final boolean contains(final double[] pItems,
            final double pItem) {
        for (int i = pItems.length - 1; i >= 0; i--) {
            if (pItems[i] == pItem) {
                return true;
            }
        }
        return false;
    }
}

Related

  1. contains(boolean[] array, boolean valueToFind)
  2. contains(byte[] array, byte valueToFind)
  3. contains(char[] array, char valueToFind)
  4. contains(double[] array, double valueToFind)
  5. contains(double[] array, double valueToFind, double tolerance)
  6. contains(final char[] pItems, final char pItem)
  7. contains(final double[] pItems, final double pItem)
  8. contains(final float[] pItems, final float pItem)
  9. contains(final int[] pItems, final int pItem)