List of utility methods to do Collection Remove
List | getItemsStartingWith(Collection get Items Starting With List<String> rtn = new ArrayList<String>(); for (String s : items) { if (s.startsWith(prefix)) { if (removePrefix) { s = s.substring(prefix.length()); rtn.add(s); return rtn; |
Collection | getRemovedItems(Collection get Removed Items return getAddedItems(newValues, oldValues);
|
Collection | minus(Collection Return a new Collection containing the elements of Collection a minus elements of Collection b target.clear(); for (T elem : primaryCollection) { if (!toBeRemovedCollection.contains(elem)) { target.add(elem); return target; |
void | remove(Collection c, Object o) remove c.remove(o); |
boolean | remove(Collection collection, Object object) remove boolean removed = false; Iterator it = collection.iterator(); while (it.hasNext()) { Object o = it.next(); if (o.equals(object)) { removed = true; it.remove(); break; ... |
Collection | remove(Collection p_collection, int p_index, int p_numberOfObjects) Removes the element at the specified position in the collection. if (p_collection == null) { return null; List returnList = new ArrayList(p_collection.size() - p_numberOfObjects); Iterator it = p_collection.iterator(); for (int i = 0; it.hasNext(); i++) { if (i < p_index || i >= p_index + p_numberOfObjects) { returnList.add(it.next()); ... |
boolean | remove(Collection remove if (col == null) { return false; return col.remove(value); |
List | remove(Collection Removes the specified number of elements from the collection, returns them as a list. List<T> list = new ArrayList<T>(); while (list.size() < count && collection.size() > 0) { T value = collection.iterator().next(); list.add(value); collection.remove(value); return list; |
void | remove(Collection Removes items from collection for (T t : items) {
collection.remove(t);
|
boolean | remove(final Collection> c, final Object elem) remove return (c != null) && c.remove(elem);
|