Java Collection Remove removeAll(final Collection c, final Object... array)

Here you can find the source of removeAll(final Collection c, final Object... array)

Description

remove All

License

Open Source License

Declaration

public static boolean removeAll(final Collection<?> c, final Object... array) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Collection;

public class Main {
    public static boolean removeAll(final Collection<?> c, final Object... array) {
        boolean result = false;

        for (final Object element : array) {
            result |= c.remove(element);
        }/*from ww w .ja  v a2s. co m*/

        return result;
    }

    public static boolean removeAll(final Collection<? super Byte> c, final boolean... array) {
        boolean result = false;

        for (final boolean element : array) {
            result |= c.remove(element);
        }

        return result;
    }

    public static boolean removeAll(final Collection<? super Byte> c, final byte... array) {
        boolean result = false;

        for (final byte element : array) {
            result |= c.remove(element);
        }

        return result;
    }

    public static boolean removeAll(final Collection<? super Character> c, final char... array) {
        boolean result = false;

        for (final char element : array) {
            result |= c.remove(element);
        }

        return result;
    }

    public static boolean removeAll(final Collection<? super Short> c, final short... array) {
        boolean result = false;

        for (final short element : array) {
            result |= c.remove(element);
        }

        return result;
    }

    public static boolean removeAll(final Collection<? super Integer> c, final int... array) {
        boolean result = false;

        for (final int element : array) {
            result |= c.remove(element);
        }

        return result;
    }

    public static boolean removeAll(final Collection<? super Long> c, final long... array) {
        boolean result = false;

        for (final long element : array) {
            result |= c.remove(element);
        }

        return result;
    }

    public static boolean removeAll(final Collection<? super Float> c, final float... array) {
        boolean result = false;

        for (final float element : array) {
            result |= c.remove(element);
        }

        return result;
    }

    public static boolean removeAll(final Collection<? super Double> c, final double... array) {
        boolean result = false;

        for (final double element : array) {
            result |= c.remove(element);
        }

        return result;
    }

    public static boolean removeAll(final Collection<?> c, final Object[] array, final int off, final int len) {
        final int end = off + len;
        boolean result = false;

        for (int i = off; i < end; i++) {
            result |= c.remove(array[i]);
        }

        return result;
    }

    public static boolean removeAll(final Collection<? super Byte> c, final boolean[] array, final int off,
            final int len) {
        final int end = off + len;
        boolean result = false;

        for (int i = off; i < end; i++) {
            result |= c.remove(array[i]);
        }

        return result;
    }

    public static boolean removeAll(final Collection<? super Byte> c, final byte[] array, final int off,
            final int len) {
        final int end = off + len;
        boolean result = false;

        for (int i = off; i < end; i++) {
            result |= c.remove(array[i]);
        }

        return result;
    }

    public static boolean removeAll(final Collection<? super Character> c, final char[] array, final int off,
            final int len) {
        final int end = off + len;
        boolean result = false;

        for (int i = off; i < end; i++) {
            result |= c.remove(array[i]);
        }

        return result;
    }

    public static boolean removeAll(final Collection<? super Short> c, final short[] array, final int off,
            final int len) {
        final int end = off + len;
        boolean result = false;

        for (int i = off; i < end; i++) {
            result |= c.remove(array[i]);
        }

        return result;
    }

    public static boolean removeAll(final Collection<? super Integer> c, final int[] array, final int off,
            final int len) {
        final int end = off + len;
        boolean result = false;

        for (int i = off; i < end; i++) {
            result |= c.remove(array[i]);
        }

        return result;
    }

    public static boolean removeAll(final Collection<? super Long> c, final long[] array, final int off,
            final int len) {
        final int end = off + len;
        boolean result = false;

        for (int i = off; i < end; i++) {
            result |= c.remove(array[i]);
        }

        return result;
    }

    public static boolean removeAll(final Collection<? super Float> c, final float[] array, final int off,
            final int len) {
        final int end = off + len;
        boolean result = false;

        for (int i = off; i < end; i++) {
            result |= c.remove(array[i]);
        }

        return result;
    }

    public static boolean removeAll(final Collection<? super Double> c, final double[] array, final int off,
            final int len) {
        final int end = off + len;
        boolean result = false;

        for (int i = off; i < end; i++) {
            result |= c.remove(array[i]);
        }

        return result;
    }
}

Related

  1. removeAll(Collection ret, Object[] elements)
  2. removeAll(Collection collection, Collection remove)
  3. removeAll(Collection collection, T... elementsToRemove)
  4. removeAll(Collection left, Collection right)
  5. removeAll(Collection source, Collection remove)
  6. removeAll(final Collection collection, final Collection remove)
  7. removeAll(final Collection collection, final T... objects)
  8. removeAllElements(Collection data, T value)
  9. removeAllFromCollection(Collection collection, Collection toRemove)

  10. HOME | Copyright © www.java2s.com 2016