/** * Removes the element from the set represented by given data array, if it * occurs there. * * @param d * the elements of the set * @param e * the element to be removed from the array * @return {@code true} if the set has changed (the element is added), * {@code false} otherwise */ static <E> boolean remove(E[] d, Object o) { int pos = getPosition(d, o); if (d[pos] == null) return false; // else remove(d, pos); return true; } }
/** * Removes the element from the set represented by given data array, if it * occurs there. * * @param d * the elements of the set * @param e * the element to be removed from the array * @return {@code true} if the set has changed (the element is added), * {@code false} otherwise */ static <E> boolean remove(E[] d, Object o) { int pos = getPosition(d, o); if (d[pos] == null) return false; // else remove(d, pos); return true; } }
/** * Removes the element from the set represented by given data array, if it * occurs there. * * @param d * the elements of the set * @param e * the element to be removed from the array * @return {@code true} if the set has changed (the element is added), * {@code false} otherwise */ static <E> boolean remove(E[] d, Object o) { int pos = getPosition(d, o); if (d[pos] == null) return false; // else remove(d, pos); return true; } }
@Override public boolean remove(Object o) { if (o == null) throw new NullPointerException(); boolean removed = LinearProbing.remove(data, o); if (removed && --size == LinearProbing.getLowerSize(data.length)) shrink(); return removed; }
/** * Remove the entry in the keys and values such that the key of the entry is * equal to the given object according to the equality function. * * @param keys * the array of keys * @param values * the arrays of values * @param key * the key for which to delete the entry * @return the value of the deleted entry, <tt>null</tt> if nothing has been * deleted */ private static <K, V> V removeEntry(K[] keys, V[] values, Object key) { int pos = LinearProbing.getPosition(keys, key); if (keys[pos] == null) return null; // else V result = values[pos]; LinearProbing.remove(keys, values, pos); return result; }
/** * Remove the entry in the keys and values such that the key of the entry is * equal to the given object according to the equality function. * * @param keys * the array of keys * @param values * the arrays of values * @param key * the key for which to delete the entry * @return the value of the deleted entry, <tt>null</tt> if nothing has been * deleted */ private static <K, V> V removeEntry(K[] keys, V[] values, Object key) { int pos = LinearProbing.getPosition(keys, key); if (keys[pos] == null) return null; // else V result = values[pos]; LinearProbing.remove(keys, values, pos); return result; }
/** * Remove the entry in the keys and values such that the key of the entry is * equal to the given object according to the equality function. * * @param keys * the array of keys * @param values * the arrays of values * @param key * the key for which to delete the entry * @return the value of the deleted entry, <tt>null</tt> if nothing has been * deleted */ private static <K, V> V removeEntry(K[] keys, V[] values, Object key) { int pos = LinearProbing.getPosition(keys, key); if (keys[pos] == null) return null; // else V result = values[pos]; LinearProbing.remove(keys, values, pos); return result; }
@Override public boolean remove(Object o) { if (o == null) throw new NullPointerException(); boolean removed = LinearProbing.remove(data, o); if (removed && --size == LinearProbing.getLowerSize(data.length)) shrink(); return removed; }
@Override public boolean remove(Object o) { if (o == null) throw new NullPointerException(); boolean removed = LinearProbing.remove(data, o); if (removed && --size == LinearProbing.getLowerSize(data.length)) shrink(); return removed; }