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

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

Description

contains

Declaration

public static final boolean contains(final short[] pItems,
            final short 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  . ja va2s .  co 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 char[] pItems, final char pItem)
  2. contains(final double[] pItems, final double pItem)
  3. contains(final float[] pItems, final float pItem)
  4. contains(final int[] pItems, final int pItem)
  5. contains(final long[] pItems, final long pItem)
  6. contains(float[] array, float valueToFind)
  7. contains(int[] array, int value)
  8. contains(int[] array, int valueToFind)
  9. contains(long[] array, long valueToFind)