List of utility methods to do List Remove
void | removeAll(List Removes all specified positions (which msut be given in ascending order) from the list. int removed = 0; for (int idx : idxs) { values.remove(idx - removed); removed++; |
List | removeAll(List Removes all occurences of a String from a List . if (strings == null) { throw new IllegalArgumentException("List<String> cannot be null"); if (string == null) { throw new IllegalArgumentException("String cannot be null"); List<String> list = new ArrayList<>(strings); Iterator<String> iterator = list.iterator(); ... |
void | removeAll(List Removes from the given list the elements at the given indexes. if (list == null || indexes == null) { return; Collections.sort(indexes, Collections.reverseOrder()); for (Integer index : indexes) { list.remove((int) index); |
List | removeAll(List Convenient method to remove elements from a collection. ArrayList<T> subtract = new ArrayList<>(toRemoveFrom); subtract.removeAll(elementsToRemove); return subtract; |
boolean | removeAllNull(List Removes all the null objects from the list return list.removeIf((e) -> (null == e));
|
void | removeAllNulls(List list) This method removes all nulls from the given List. while (list.remove(null))
;
|
List | removeBlankLine(List remove Blank Line List<String> result = new ArrayList<String>(); for (String line : lines) { if (line == null) { continue; String temp = line.trim(); if (temp.length() == 0) { continue; ... |
void | removeByRef(List list, Object obj) remove By Ref int index = indexOfByRef(list, obj); if (index >= 0) { list.remove(index); |
void | removeElement(T element, List remove Element if (list != null)
list.remove(element);
|
List | removeElementsFromList(List remove Elements From List if (elementsToRemove == null) { return inputList; List<T> filteredList = new ArrayList<T>(inputList); for (Object objectToRemove : elementsToRemove) { for (int i = 0; i < filteredList.size(); i++) { if (filteredList.get(i).equals(objectToRemove)) { filteredList.remove(i); ... |