public void remove() throws IOException { writer.remove(); }
@Override public void remove() throws IOException { w.remove(); }
public void remove() { try { writer.remove(); } catch (IOException problem) { throw (IllegalStateException) new IllegalStateException("Could not remove feature").initCause(problem); } }
public void remove() { try { writer.remove(); } catch (IOException problem) { throw (IllegalStateException) new IllegalStateException("Could not remove feature").initCause(problem); } } /**
public void remove() throws IOException { if (writer == null) { throw new IOException("FeatureWriter has been closed"); } if (current == null) { // We do not have a current Feature // Either: // - we have not started yet // - hasNext() has already skipped current // - write() has already writen current // - remove() has already deleted current throw new IOException("No feature available to remove"); } current = null; writer.remove(); }
/** @see org.geotools.data.FeatureWriter#remove() */ public void remove() throws IOException { if (writer == null) { throw new IOException("FeatureWriter has been closed"); } state.fireFeatureRemoved(store, feature); writer.remove(); }
public void remove() throws IOException { if (live != null) { assertAccess(typeName, live.getID(), transaction); } writer.remove(); live = null; }
/** * Removes the features from the store which match the specified filter. * * <p>This method operates by obtaining an updating feature writer based on the specified * <tt>filter</tt> and removing every feature from it. * * <p>The <tt>filter</tt> must not be <code>null</code>, in this case this method will throw an * {@link IllegalArgumentException}. */ public void removeFeatures(Filter filter) throws IOException { if (filter == null) { String msg = "Must specify a filter, must not be null."; throw new IllegalArgumentException(msg); } filter = resolvePropertyNames(filter); // grab a feature writer FeatureWriter<SimpleFeatureType, SimpleFeature> writer = getWriter(filter, WRITER_UPDATE); try { // remove everything while (writer.hasNext()) { writer.next(); writer.remove(); } } finally { writer.close(); } } }
while (writer.hasNext()) { writer.next(); writer.remove();
/** @see FeatureStore#removeFeatures(Filter) */ public void removeFeatures(final Filter filter) throws IOException { final Transaction currTransaction = getTransaction(); final String typeName = typeInfo.getFeatureTypeName(); // short circuit cut if needed to remove all features // if (Filter.INCLUDE == filter) { // truncate(typeName, connection); // return; // } final FeatureWriter<SimpleFeatureType, SimpleFeature> writer; writer = dataStore.getFeatureWriter(typeName, filter, currTransaction); try { while (writer.hasNext()) { writer.next(); writer.remove(); } } finally { writer.close(); } }
public void testGetFeatureWriterRemove() throws IOException { FeatureWriter<SimpleFeatureType, SimpleFeature> writer = data.getFeatureWriter("road", Transaction.AUTO_COMMIT); SimpleFeature feature; while (writer.hasNext()) { feature = writer.next(); if (feature.getID().equals("road.rd1")) { writer.remove(); } } assertEquals(roadFeatures.length - 1, data.entry("road").getMemory().size()); }
public void testGetFeatureWriterRemove() throws IOException { try (FeatureWriter<SimpleFeatureType, SimpleFeature> writer = writer(tname("road"))) { SimpleFeature feature; while (writer.hasNext()) { feature = (SimpleFeature) writer.next(); if (feature.getID().equals(td.roadFeatures[0].getID())) { writer.remove(); } } } assertEquals(td.roadFeatures.length - 1, count(tname("road"))); }
writer.remove();
public void remove() { try { writer.remove(); } catch (IOException problem) { throw (IllegalStateException) new IllegalStateException( "Could not remove feature" ).initCause( problem ); } } public void close(){
public void testGetFeatureWriterRemoveAll() throws IOException { try (FeatureWriter<SimpleFeatureType, SimpleFeature> writer = writer(tname("road"))) { SimpleFeature feature; while (writer.hasNext()) { feature = (SimpleFeature) writer.next(); writer.remove(); } } assertEquals(0, count(tname("road"))); }
public void remove() throws IOException { if (live != null) { assertAccess(typeName, live.getID(), transaction); } writer.remove(); live = null; }
writer.remove();
writer.remove();
feature = (SimpleFeature) writer1.next(); assertEquals("road.rd1", feature.getID()); writer1.remove();
feature = (SimpleFeature) writer1.next(); assertEquals(td.roadFeatures[0].getID(), feature.getID()); writer1.remove();