Java Utililty Methods List Remove

List of utility methods to do List Remove

Description

The list of methods to do List Remove are organized into topic(s).

Method

String[]removeMember(String[] list, String id)
Remove all instances of the given id from the member list.
List<String> newList = new ArrayList<String>(Arrays.asList(list));
newList.remove(id);
return newList.toArray(new String[newList.size()]);
booleanremoveObject(List l, T o)
Removes the first occurrence in the list of the specified object, using object identity (==) not equality as the criterion for object presence.
int i = 0;
for (Object o1 : l) {
    if (o == o1) {
        l.remove(i);
        return true;
    } else
        i++;
return false;
ListremoveObjectList(List list, V o)
remove Object List
if (list == null) {
    list = new ArrayList<T>(1);
list.remove(o);
return list;
ObjectremoveReference(List l, Object o)
remove Reference
Iterator iter = l.iterator();
while (iter.hasNext()) {
    Object no = iter.next();
    if (no == o) {
        iter.remove();
        return o;
return null;