01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2005-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.feature.collection;
17:
18: import java.util.NoSuchElementException;
19: import org.geotools.feature.Feature;
20: import org.geotools.feature.FeatureCollection;
21:
22: /**
23: * Access Feature content using Feature "Id".
24: * <p>
25: * Many FeatureCollection classes will make use of this
26: * API to avoid unnecessary caching of content. Supporting
27: * this interface will allow SubCollections to occur based
28: * on FeatureIds, with a suitable improvement in memory
29: * consumption.
30: * </p>
31: * <p>
32: * For an addition improvement in memory comsumption SubCollections
33: * may use of a sparse reprsentation where only (beginId,endId] ranges
34: * are kept in memory.
35: * </p>
36: * @author Jody Garnett, Refractions Research Inc.
37: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/feature/collection/RandomFeatureAccess.java $
38: */
39: public interface RandomFeatureAccess extends FeatureCollection {
40: /**
41: * Access Feature content by feature id.
42: *
43: * @param id
44: * @return Feature with the indicated or id
45: * @throws NoSuchElementException if a Feature with the indicated id is not present
46: */
47: public Feature getFeatureMember(String id)
48: throws NoSuchElementException;
49:
50: /** Optional Method */
51: public Feature removeFeatureMember(String id);
52: }
|