001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2006, GeoTools Project Managment Committee (PMC)
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation;
009: * version 2.1 of the License.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: */
016: package org.geotools.data.store;
017:
018: import java.io.IOException;
019: import java.util.List;
020: import org.opengis.feature.type.TypeName;
021: import org.opengis.filter.Filter;
022: import org.geotools.catalog.GeoResourceInfo;
023: import org.geotools.feature.FeatureCollection;
024: import org.geotools.feature.FeatureList;
025:
026: /**
027: * Class is used to provide data access for ContentDataStore.
028: *
029: * @author Jody Garnett, Refractions Research Inc.
030: */
031: public abstract class Content {
032: /**
033: * List of TypeNames indicating available content.
034: * @return List<TypeName>
035: */
036: public abstract List getTypeNames() throws IOException;
037:
038: /**
039: * Summary information, providing access to such metadata as is available.
040: * <p>
041: * Metadata is usually available in file headers, table information
042: * or data descriptors.
043: */
044: public abstract GeoResourceInfo info(ContentState state);
045:
046: /**
047: * Produce an entry representing the provided typeName.
048: * @param dataStore
049: * @param typeName
050: * @return entry representing the provided typeName
051: */
052: public abstract ContentEntry entry(ContentDataStore dataStore,
053: TypeName typeName);
054:
055: /**
056: * Track per transaction state.
057: *
058: * @param entry
059: * @return per transaction state.
060: */
061: public abstract ContentState state(ContentEntry entry);
062:
063: /**
064: * FeatureCollection representing the entire contents.
065: * <p>
066: * Available via getFeatureSource():
067: * <ul>
068: * <li>getFeatures()
069: * <li>getFeatures( Filter.INCLUDES )
070: * </ul>
071: *
072: * @param state
073: * @return all content
074: */
075: public abstract FeatureCollection all(ContentState state);
076:
077: /**
078: * FeatureCollection representing a subset of available content.
079: * <p>
080: * Available via getFeatureSource():
081: * <ul>
082: * <li>getFeatures().filter( filter )
083: * <li>getFeatures( filter )
084: * </ul>
085: * @param state
086: * @param filter
087: * @return subset of content
088: */
089: public abstract FeatureCollection filter(ContentState state,
090: Filter filter);
091:
092: /**
093: * FeatureList representing sorted content.
094: * <p>
095: * Available via getFeatureSource():
096: * <ul>
097: * <li>getFeatures().sort( sort )
098: * <li>getFeatures( filter ).sort( sort )
099: * <li>getFeatures( filter ).sort( sort ).sort( sort1 );
100: * </ul>
101: * @param state
102: * @param filter
103: * @param order List<SortBy> used to determine sort order
104: * @return subset of content
105: */
106: public abstract FeatureList sorted(ContentState state,
107: Filter filter, List order);
108:
109: /**
110: * FeatureCollection optimized for read-only access.
111: * <p>
112: * Available via getView( filter ):
113: * <ul>
114: * <li>getFeatures().sort( sort )
115: * <li>getFeatures( filter ).sort( sort )
116: * </ul>
117: * <p>
118: * In particular this method of data access is intended for rendering and other high speed
119: * operations; care should be taken to optimize the use of FeatureVisitor.
120: * <p>
121: * @param state
122: * @param filter
123: * @return readonly access
124: */
125: public abstract FeatureCollection readonly(ContentState state,
126: Filter filter);
127: }
|