Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package cz.geek.util;
 
 import java.util.List;
 
 public abstract class ListUtils {

Delete items from given list at given indexes

Parameters:
list list
indexes indexes to remove (may be null)
Throws:
java.lang.UnsupportedOperationException if the remove method is not supported by this list.
java.lang.IndexOutOfBoundsException if one of indexes is out of range < 0 || index >= size()).
	public static void delete(List<?> listInteger[] indexesthrows IndexOutOfBoundsExceptionUnsupportedOperationException {
		if (indexes == null)
			return;
		if (indexes.length > 1)
			Arrays.sort(indexes);
		for (int i=0; i<indexes.lengthi++)
			list.remove(indexes[i]-i);
	}
New to GrepCode? Check out our FAQ X