Java List Remove remove(List aList, Object anObj)

Here you can find the source of remove(List aList, Object anObj)

Description

Removes given object from given list (accepts null list).

License

Open Source License

Declaration

public static boolean remove(List aList, Object anObj) 

Method Source Code


//package com.java2s;

import java.util.*;

public class Main {
    /**/*from w ww.  j a  va  2 s . c o m*/
     * Removes given object from given list (accepts null list).
     */
    public static boolean remove(List aList, Object anObj) {
        return aList == null ? false : aList.remove(anObj);
    }

    /**
     * Removes range of objects from given list (from start to end, not including end).
     */
    public static void remove(List aList, int start, int end) {
        for (int i = end - 1; i >= start; i--)
            aList.remove(i);
    }
}

Related

  1. remove(Collection entityList1, Collection entityList2, Comparator comparator)
  2. remove(final List list, final int index, final T defaultValue)
  3. remove(final List list, final T... objects)
  4. remove(List models, int start, int count)
  5. remove(List list, List elements)
  6. remove(List list, Class type)
  7. remove(List as, int start, int end)