/** * Removes all element of the given {@link Collection} from the given slice * * @param s * the slice id * @param c * the collection whose elements should be removed * @return {@code true} if at least one element is removed from the slice. * An element is removed if an equal element is present in the given * collection. If no elements are removed, {@code false} is returned * and nothing is modified. */ public boolean removeAll(int s, Collection<?> c) { boolean modified = false; for (Object o : c) { modified |= remove(s, o); } return modified; }
/** * Removes all element of the given {@link Collection} from the given slice * * @param s * the slice id * @param c * the collection whose elements should be removed * @return {@code true} if at least one element is removed from the slice. * An element is removed if an equal element is present in the given * collection. If no elements are removed, {@code false} is returned * and nothing is modified. */ public boolean removeAll(int s, Collection<?> c) { boolean modified = false; for (Object o : c) { modified |= remove(s, o); } return modified; }
/** * Removes all element of the given {@link Collection} from the given slice * * @param s * the slice id * @param c * the collection whose elements should be removed * @return {@code true} if at least one element is removed from the slice. * An element is removed if an equal element is present in the given * collection. If no elements are removed, {@code false} is returned * and nothing is modified. */ public boolean removeAll(int s, Collection<?> c) { boolean modified = false; for (Object o : c) { modified |= remove(s, o); } return modified; }
private static <E> int removeMask(byte sl, E[] data, int[] masks, Object o, int mask) { int pos = LinearProbing.getPosition(data, o); if (data[pos] == null) return 0; // else int oldFragment = getFragment(sl, masks, pos); int newFragment = oldFragment & (~mask); if (newFragment == 0) remove(sl, data, masks, pos); else changeFragment(sl, masks, pos, oldFragment ^ newFragment); return oldFragment; }
private static <E> int removeMask(byte sl, E[] data, int[] masks, Object o, int mask) { int pos = LinearProbing.getPosition(data, o); if (data[pos] == null) return 0; // else int oldFragment = getFragment(sl, masks, pos); int newFragment = oldFragment & (~mask); if (newFragment == 0) remove(sl, data, masks, pos); else changeFragment(sl, masks, pos, oldFragment ^ newFragment); return oldFragment; }
private static <E> int removeMask(byte sl, E[] data, int[] masks, Object o, int mask) { int pos = LinearProbing.getPosition(data, o); if (data[pos] == null) return 0; // else int oldFragment = getFragment(sl, masks, pos); int newFragment = oldFragment & (~mask); if (newFragment == 0) remove(sl, data, masks, pos); else changeFragment(sl, masks, pos, oldFragment ^ newFragment); return oldFragment; }