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

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

Description

contains

Declaration

public static final boolean contains(final long[] pItems,
            final long 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;
            }/*from   w w  w .java  2s  .c  o  m*/
        }
        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(final byte[] pItems, final byte pItem)
  2. contains(final char[] pItems, final char pItem)
  3. contains(final double[] pItems, final double pItem)
  4. contains(final float[] pItems, final float pItem)
  5. contains(final int[] pItems, final int pItem)
  6. contains(final short[] pItems, final short pItem)
  7. contains(float[] array, float valueToFind)
  8. contains(int[] array, int value)
  9. contains(int[] array, int valueToFind)