@Test public void testSorting() throws Exception { final String typeName = testData.getTempTableName(); SimpleFeatureSource fs = store.getFeatureSource(typeName); Query query = new Query(typeName); final String sortAtt = "INT32_COL"; SortBy[] sortBy; SimpleFeatureIterator features; sortBy = new SortBy[] { ff.sort(sortAtt, ASCENDING) }; query.setSortBy(sortBy); features = fs.getFeatures(query).features(); try { Integer previous = Integer.valueOf(Integer.MIN_VALUE); while (features.hasNext()) { Integer intVal = (Integer) features.next().getAttribute(sortAtt); assertTrue(previous + " < " + intVal + "?", previous.intValue() < intVal.intValue()); previous = intVal; } } finally { features.close(); } sortBy = new SortBy[] { ff.sort(sortAtt, DESCENDING) }; query.setSortBy(sortBy); features = fs.getFeatures(query).features(); try { Integer previous = Integer.valueOf(Integer.MAX_VALUE); while (features.hasNext()) { Integer intVal = (Integer) features.next().getAttribute(sortAtt); assertTrue(previous + " > " + intVal + "?", previous.intValue() > intVal.intValue()); previous = intVal; } } finally { features.close(); } sortBy = new SortBy[] { ff.sort(sortAtt, DESCENDING), ff.sort("FLOAT32_COL", ASCENDING) }; query.setSortBy(sortBy); features = fs.getFeatures(query).features(); try { Integer previous = Integer.valueOf(Integer.MAX_VALUE); while (features.hasNext()) { Integer intVal = (Integer) features.next().getAttribute(sortAtt); assertTrue(previous + " > " + intVal + "?", previous.intValue() > intVal.intValue()); previous = intVal; } } finally { features.close(); } }
public final SimpleFeatureCollection getFeatures(final Query query) throws IOException { final Query namedQuery = namedQuery(query); SimpleFeatureCollection collection; SimpleFeatureType queryType = dataStore.getQueryType(namedQuery); collection = new ArcSdeFeatureCollection(this, queryType, namedQuery); return collection; }
ArcSdeFeatureSource implements SimpleFeatureSource { public final SimpleFeatureCollection getFeatures(final Query query) throws IOException { final Query namedQuery = namedQuery(query); SimpleFeatureCollection collection; SimpleFeatureType queryType = dataStore.getQueryType(namedQuery); collection = new ArcSdeFeatureCollection(this, queryType, namedQuery); return collection; } }
ArcSdeFeatureSource implements SimpleFeatureSource { public final SimpleFeatureCollection getFeatures(final Query query) throws IOException { final Query namedQuery = namedQuery(query); SimpleFeatureCollection collection; SimpleFeatureType queryType = dataStore.getQueryType(namedQuery); collection = new ArcSdeFeatureCollection(this, queryType, namedQuery); return collection; } ArcSdeFeatureSource(final FeatureTypeInfo typeInfo, final ArcSDEDataStore dataStore); }
ArcSdeFeatureSource implements SimpleFeatureSource { public final SimpleFeatureCollection getFeatures(final Query query) throws IOException { final Query namedQuery = namedQuery(query); SimpleFeatureCollection collection; SimpleFeatureType queryType = dataStore.getQueryType(namedQuery); collection = new ArcSdeFeatureCollection(this, queryType, namedQuery); return collection; } ArcSdeFeatureSource(final FeatureTypeInfo typeInfo, final ArcSDEDataStore dataStore); Name getName(); synchronized ArcSdeResourceInfo getInfo(); QueryCapabilities getQueryCapabilities(); final void addFeatureListener(final FeatureListener listener); final void removeFeatureListener(final FeatureListener listener); final ReferencedEnvelope getBounds(); final ReferencedEnvelope getBounds(final Query query); final int getCount(final Query query); final ArcSDEDataStore getDataStore(); final SimpleFeatureCollection getFeatures(final Query query); final SimpleFeatureCollection getFeatures(final Filter filter); final SimpleFeatureCollection getFeatures(); final SimpleFeatureType getSchema(); final Set<RenderingHints.Key> getSupportedHints(); ArcSdeVersionHandler getVersionHandler(); FeatureReader<SimpleFeatureType, SimpleFeature> getfeatureReader(
            SimpleFeatureType targetSchema, Query query); }
ArcSdeFeatureSource implements SimpleFeatureSource { public final SimpleFeatureCollection getFeatures(final Query query) throws IOException { final Query namedQuery = namedQuery(query); SimpleFeatureCollection collection; SimpleFeatureType queryType = dataStore.getQueryType(namedQuery); collection = new ArcSdeFeatureCollection(this, queryType, namedQuery); return collection; } ArcSdeFeatureSource(final FeatureTypeInfo typeInfo, final ArcSDEDataStore dataStore); Name getName(); synchronized ArcSdeResourceInfo getInfo(); QueryCapabilities getQueryCapabilities(); final void addFeatureListener(final FeatureListener listener); final void removeFeatureListener(final FeatureListener listener); final ReferencedEnvelope getBounds(); final ReferencedEnvelope getBounds(final Query query); final int getCount(final Query query); final ArcSDEDataStore getDataStore(); final SimpleFeatureCollection getFeatures(final Query query); final SimpleFeatureCollection getFeatures(final Filter filter); final SimpleFeatureCollection getFeatures(); final SimpleFeatureType getSchema(); final Set<RenderingHints.Key> getSupportedHints(); ArcSdeVersionHandler getVersionHandler(); FeatureReader<SimpleFeatureType, SimpleFeature> getfeatureReader(
            SimpleFeatureType targetSchema, Query query);  }