/** * Removes a set of given elements from this set. * * @param collect the element set to be removed. * @return true if the removal succeeds. * @throws DataAccessLayerException in case of data access failure. */ public boolean removeAll(final Collection<? extends E> collect) throws DataAccessLayerException { boolean changed = false; for (E obj : collect) { changed = changed | _map.remove(obj) == null ? false : true; } return changed; }
/** * Removes a set of given elements from this set. * * @param collect the element set to be removed. * @return true if the removal succeeds. * @throws DataAccessLayerException in case of data access failure. */ public boolean removeAll(final Collection<? extends E> collect) throws DataAccessLayerException { boolean changed = false; for (E obj : collect) { changed = changed | _map.remove(obj) == null ? false : true; } return changed; }
/** * Removes the given element from this set. * * @param o the element to be removed. * @return true if the removal succeeds. * @throws DataAccessLayerException in case of data access failure. */ public boolean remove(final E o) throws DataAccessLayerException { return o == null ? false : (Arrays.equals(_map.remove(o), PRESENT)); }
/** * Removes the given element from this set. * * @param o the element to be removed. * @return true if the removal succeeds. * @throws DataAccessLayerException in case of data access failure. */ public boolean remove(final E o) throws DataAccessLayerException { return o == null ? false : (Arrays.equals(_map.remove(o), PRESENT)); }
/** * Clears all entries from the underlying persistent entity. * * @throws DataAccessLayerException in case of data access failure. */ public void clear() throws DataAccessLayerException { for (final K key : keySet()) { remove(key); } _size = 0; }
/** * Clears all entries from the underlying persistent entity. * * @throws DataAccessLayerException in case of data access failure. */ public void clear() throws DataAccessLayerException { for (final K key : keySet()) { remove(key); } _size = 0; }
@Override public void remove() throws SailException { if (_current != null) { try { _crdf.getPrefix2Namespaces().remove(_current.getKey()); } catch (DataAccessLayerException exception) { throw new SailException(exception); } } } };
@Override public void remove() throws SailException { if (_current != null) { try { _crdf.getPrefix2Namespaces().remove(_current.getKey()); } catch (DataAccessLayerException exception) { throw new SailException(exception); } } } };
@Override protected void removeNamespaceInternal(final String prefix) throws SailException { try { _crdf.getPrefix2Namespaces().remove(prefix); } catch (DataAccessLayerException exception) { throw new SailException(exception); } }
@Override protected void removeNamespaceInternal(final String prefix) throws SailException { try { _crdf.getPrefix2Namespaces().remove(prefix); } catch (DataAccessLayerException exception) { throw new SailException(exception); } }
@Override protected void clearNamespacesInternal() throws SailException { try { PersistentMap<String, String> prefix2ns = _crdf.getPrefix2Namespaces(); for (String prefix : prefix2ns.keySet()) { prefix2ns.remove(prefix); } } catch (DataAccessLayerException exception) { throw new SailException(exception); } }
@Override protected void clearNamespacesInternal() throws SailException { try { PersistentMap<String, String> prefix2ns = _crdf.getPrefix2Namespaces(); for (String prefix : prefix2ns.keySet()) { prefix2ns.remove(prefix); } } catch (DataAccessLayerException exception) { throw new SailException(exception); } }
@Before public void reset() throws DataAccessLayerException { for (String key : map.keySet()) { map.remove(key); } for (Map.Entry<String, String> entry : TESTDATA1.entrySet()) { map.put(entry.getKey(), entry.getValue()); } }
@Test public void removeTest() throws DataAccessLayerException { assertEquals(TESTDATA1.size(), map.size()); for (String key : TESTDATA4.keySet()) { assertNull(map.remove(key)); } for (String key : TESTDATA1.keySet()) { assertEquals(TESTDATA1.get(key), map.remove(key)); } assertTrue(map.isEmpty()); }