/** * Adds a single Feature to the correct typeName entry. * * <p>This is an internal operation used for setting up MemoryDataStore - please use * FeatureWriter for general use. * * <p>This method is willing to create new FeatureTypes for MemoryDataStore. * * @param feature Individual feature to add */ public void addFeature(SimpleFeature feature) { synchronized (entries) { addFeatureInternal(feature); } }
/** * Configures MemoryDataStore with feature array. * * @param features Array of features to add * @throws IllegalArgumentException If provided feature array is empty */ public void addFeatures(SimpleFeature[] features) { if ((features == null) || (features.length == 0)) { throw new IllegalArgumentException("Provided features are empty"); } synchronized (entries) { for (int i = 0; i < features.length; i++) { addFeatureInternal(features[i]); } } }
/** * Configures MemoryDataStore with Collection. * * <p>You may use this to create a MemoryDataStore from a FeatureCollection. * * @param collection Collection of features to add * @throws IllegalArgumentException If provided collection is empty */ public void addFeatures(Collection<?> collection) { if ((collection == null) || collection.isEmpty()) { throw new IllegalArgumentException("Provided Collection is empty"); } synchronized (entries) { for (Object item : collection) { addFeatureInternal((SimpleFeature) item); } } }
public void addFeatures(FeatureCollection<SimpleFeatureType, SimpleFeature> collection) { if ((collection == null)) { throw new IllegalArgumentException("Provided FeatureCollection is empty"); } synchronized (entries) { try (FeatureIterator<SimpleFeature> iterator = collection.features()) { while (iterator.hasNext()) { addFeatureInternal(iterator.next()); } } } } /**
/** * Configures MemoryDataStore with FeatureReader. * * @param reader New contents to add * @throws IOException If problems are encountered while adding * @throws DataSourceException See IOException */ public void addFeatures(SimpleFeatureIterator reader) throws IOException { try { SimpleFeature feature = reader.next(); if (feature == null) { throw new IllegalArgumentException( "Provided FeatureReader<SimpleFeatureType, SimpleFeature> is closed"); } addFeatureInternal(feature); while (reader.hasNext()) { feature = reader.next(); addFeatureInternal(feature); } } finally { reader.close(); } } /**
/** * Configures MemoryDataStore with FeatureReader. * * @param reader New contents to add * @throws IOException If problems are encountered while adding * @throws DataSourceException See IOException */ public void addFeatures(FeatureReader<SimpleFeatureType, SimpleFeature> reader) throws IOException { try { SimpleFeature feature = reader.next(); if (feature == null) { throw new IllegalArgumentException( "Provided FeatureReader<SimpleFeatureType, SimpleFeature> is closed"); } addFeatureInternal(feature); while (reader.hasNext()) { feature = reader.next(); addFeatureInternal(feature); } } catch (IllegalAttributeException e) { throw new DataSourceException("Problem using reader", e); } finally { reader.close(); } }
/** * Adds a single Feature to the correct typeName entry. * * <p> * This is an internal opperation used for setting up MemoryDataStore - please use * FeatureWriter for generatl use. * </p> * * <p> * This method is willing to create new FeatureTypes for MemoryDataStore. * </p> * * @param feature Individual feature to add */ public void addFeature(SimpleFeature feature) { synchronized (memory) { addFeatureInternal(feature); } }
/** * Adds a single Feature to the correct typeName entry. * * <p> * This is an internal opperation used for setting up MemoryDataStore - please use * FeatureWriter for generatl use. * </p> * * <p> * This method is willing to create new FeatureTypes for MemoryDataStore. * </p> * * @param feature Individual feature to add */ public void addFeature(Feature feature) { synchronized (memory) { addFeatureInternal(feature); } }
/** * Configures MemoryDataStore with feature array. * * @param features Array of features to add * * @throws IllegalArgumentException If provided feature array is empty */ public void addFeatures(SimpleFeature[] features) { if ((features == null) || (features.length == 0)) { throw new IllegalArgumentException("Provided features are empty"); } synchronized (memory) { for (int i = 0; i < features.length; i++) { addFeatureInternal(features[i]); } } }
/** * Configures MemoryDataStore with feature array. * * @param features Array of features to add * * @throws IllegalArgumentException If provided feature array is empty */ public void addFeatures(Feature[] features) { if ((features == null) || (features.length == 0)) { throw new IllegalArgumentException("Provided features are empty"); } synchronized (memory) { for (int i = 0; i < features.length; i++) { addFeatureInternal(features[i]); } } }
/** * Configures MemoryDataStore with Collection. * * <p> * You may use this to create a MemoryDataStore from a FeatureCollection. * </p> * * @param collection Collection of features to add * * @throws IllegalArgumentException If provided collection is empty */ public void addFeatures(Collection<?> collection) { if ((collection == null) || collection.isEmpty()) { throw new IllegalArgumentException("Provided SimpleFeatureCollection is empty"); } synchronized (memory) { for (Iterator<?> i = collection.iterator(); i.hasNext();) { addFeatureInternal((SimpleFeature) i.next()); } } } public void addFeatures(FeatureCollection<SimpleFeatureType,SimpleFeature> collection) {
/** * Configures MemoryDataStore with Collection. * * <p> * You may use this to create a MemoryDataStore from a FeatureCollection. * </p> * * @param collection Collection of features to add * * @throws IllegalArgumentException If provided collection is empty */ public void addFeatures(Collection collection) { if ((collection == null) || collection.isEmpty()) { throw new IllegalArgumentException("Provided FeatureCollection is empty"); } synchronized (memory) { for (Iterator i = collection.iterator(); i.hasNext();) { addFeatureInternal((Feature) i.next()); } } }