• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SortBy类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.opengis.filter.sort.SortBy的典型用法代码示例。如果您正苦于以下问题:Java SortBy类的具体用法?Java SortBy怎么用?Java SortBy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SortBy类属于org.opengis.filter.sort包,在下文中一共展示了SortBy类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setValueAt

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
@Override
public void setValueAt(Object aValue, int row, int column) {
    SortBy obj = dataList.get(row);

    switch (column) {
    case 0:
        break;
    case COL_SORT_ORDER: {
        Boolean b = (Boolean) aValue;

        SortOrder sortOrder = b.booleanValue() ? SortOrder.ASCENDING : SortOrder.DESCENDING;
        ((SortByImpl) obj).setSortOrder(sortOrder);

        fireTableCellUpdated(row, column);

        if (parentObj != null) {
            parentObj.sortOrderUpdated();
        }
        break;
    }
    default:
        break;
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:25,代码来源:SortByTableModel.java


示例2: removeSelected

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
/**
 * Removes the selected properties from the destination table and returns a list so it can be
 * added to the source list.
 *
 * @param table the table
 * @return the list of removed property names
 */
public List<String> removeSelected(JTable table) {
    List<String> itemsRemovedList = new ArrayList<String>();

    int[] selectedRows = table.getSelectedRows();
    if (selectedRows.length > 0) {
        for (int i = selectedRows.length - 1; i >= 0; i--) {
            SortBy obj = dataList.get(selectedRows[i]);

            itemsRemovedList.add(0, obj.getPropertyName().getPropertyName());
            dataList.remove(selectedRows[i]);
        }
    }

    this.fireTableDataChanged();

    if (parentObj != null) {
        parentObj.sortOrderUpdated();
    }

    return itemsRemovedList;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:29,代码来源:SortByTableModel.java


示例3: setText

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
/**
 * Sets the text.
 *
 * @param value the new text
 */
public void setText(String value) {
    Map<String, String> options = new HashMap<String, String>();

    ListSelectionModel model = destinationTable.getSelectionModel();
    model.clearSelection();

    SortBy[] sortArray = null;

    if (!value.isEmpty()) {
        options.put(FeatureTypeStyle.SORT_BY, value);

        sortArray = SLDStyleFactory.getSortBy(options);
    }
    destinationModel.populate(sortArray);
    updateLists();

    btnMoveDown.setEnabled(false);
    btnMoveUp.setEnabled(false);
    btnDestToSrcButton.setEnabled(false);
    btnSrcToDestButton.setEnabled(false);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:27,代码来源:SortByPanel.java


示例4: getQueryCapabilities

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
public QueryCapabilities getQueryCapabilities() {
    // we can do both sorting and offset locally if necessary
    return new QueryCapabilitiesDecorator(source.getQueryCapabilities()) {
        @Override
        public boolean isOffsetSupported() {
            return true;
        }
        
        @Override
        public boolean supportsSorting(SortBy[] sortAttributes) {
            return true;
        }
    };
    
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:16,代码来源:ISOGeoServerFeatureSource.java


示例5: validateSortBy

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
void validateSortBy(List<SortBy> sortBys, FeatureTypeInfo meta, final GetFeatureRequest3D request)
        throws IOException {
    FeatureType featureType = meta.getFeatureType();
    for (SortBy sortBy : sortBys) {
        PropertyName name = sortBy.getPropertyName();
        if (name.evaluate(featureType) == null) {
            throw new WFSException(request, "Illegal property name: " + name.getPropertyName()
                    + " for feature type " + meta.prefixedName(), "InvalidParameterValue");
        }
    }
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:12,代码来源:GetFeature3D.java


示例6: getValueAt

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
@Override
public Object getValueAt(int row, int column) {
    SortBy obj = dataList.get(row);

    switch (column) {
    case 0:
        return obj.getPropertyName().getPropertyName();
    case COL_SORT_ORDER:
        return isAscendingSortOrder(obj);
    default:
        break;
    }
    return null;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:15,代码来源:SortByTableModel.java


示例7: populate

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
/**
 * Populate.
 *
 * @param sortArray the sort array
 */
public void populate(SortBy[] sortArray) {
    dataList.clear();

    if (sortArray != null) {
        for (SortBy sortBy : sortArray) {
            dataList.add(sortBy);
        }
    }

    // Using fireTableStructureChanged rather than fireTableDataChanged so that the checkbox
    // editors work with undo/redo
    this.fireTableStructureChanged();
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:19,代码来源:SortByTableModel.java


示例8: getEncodedString

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
/**
 * Gets the encoded string.
 *
 * @return the encoded string
 */
public String getEncodedString() {
    List<String> list = new ArrayList<String>();

    for (SortBy sortBy : dataList) {
        String string = String.format("%s %s", sortBy.getPropertyName().getPropertyName(),
                sortBy.getSortOrder().identifier().substring(0, 1));
        list.add(string);
    }

    return String.join(", ", list);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:17,代码来源:SortByTableModel.java


示例9: containsProperty

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
/**
 * Check to see if list contains property name.
 *
 * @param item the item
 * @return true, if successful
 */
public boolean containsProperty(String item) {
    for (SortBy sortBy : dataList) {
        if (sortBy.getPropertyName().getPropertyName().equals(item)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:15,代码来源:SortByTableModel.java


示例10: moveRowDown

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
/**
 * Move row down.
 *
 * @param index the index
 */
public void moveRowDown(int index) {
    SortBy sortBy = dataList.remove(index);
    dataList.add(index + 1, sortBy);

    this.fireTableDataChanged();
    if (parentObj != null) {
        parentObj.sortOrderUpdated();
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:15,代码来源:SortByTableModel.java


示例11: moveRowUp

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
/**
 * Move row up.
 *
 * @param index the index
 */
public void moveRowUp(int index) {
    SortBy sortBy = dataList.remove(index);
    dataList.add(index - 1, sortBy);

    this.fireTableDataChanged();
    if (parentObj != null) {
        parentObj.sortOrderUpdated();
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:15,代码来源:SortByTableModel.java


示例12: secondaryIndexExample

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
static void secondaryIndexExample(String simpleFeatureTypeName,
                                  DataStore dataStore,
                                  String[] attributeFields,
                                  String attributesQuery,
                                  int maxFeatures,
                                  String sortByField)
        throws CQLException, IOException {

    // construct a (E)CQL filter from the search parameters,
    // and use that as the basis for the query
    Filter cqlFilter = CQL.toFilter(attributesQuery);
    Query query = new Query(simpleFeatureTypeName, cqlFilter);

    query.setPropertyNames(attributeFields);
    query.setMaxFeatures(maxFeatures);

    if (!sortByField.equals("")) {
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
        SortBy[] sort = new SortBy[]{ff.sort(sortByField, SortOrder.DESCENDING)};
        query.setSortBy(sort);
    }

    // submit the query, and get back an iterator over matching features
    FeatureSource featureSource = dataStore.getFeatureSource(simpleFeatureTypeName);
    FeatureIterator featureItr = featureSource.getFeatures(query).features();

    // loop through all results
    int n = 0;
    while (featureItr.hasNext()) {
        Feature feature = featureItr.next();
        StringBuilder sb = new StringBuilder();
        sb.append("Feature ID ").append(feature.getIdentifier());

        for (String field : attributeFields) {
            sb.append(" | ").append(field).append(": ").append(feature.getProperty(field).getValue());
        }
        System.out.println(sb.toString());
    }
    featureItr.close();
}
 
开发者ID:geomesa,项目名称:geomesa-tutorials,代码行数:41,代码来源:FeatureLevelVisibility.java


示例13: secondaryIndexExample

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
static void secondaryIndexExample(String simpleFeatureTypeName,
                                  DataStore dataStore,
                                  String[] attributeFields,
                                  String attributesQuery,
                                  int maxFeatures,
                                  String sortByField)
        throws CQLException, IOException {

    // construct a (E)CQL filter from the search parameters,
    // and use that as the basis for the query
    Filter cqlFilter = CQL.toFilter(attributesQuery);
    Query query = new Query(simpleFeatureTypeName, cqlFilter);

    query.setPropertyNames(attributeFields);
    query.setMaxFeatures(maxFeatures);

    if (!sortByField.equals("")) {
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
        SortBy[] sort = new SortBy[]{ff.sort(sortByField, SortOrder.DESCENDING)};
        query.setSortBy(sort);
    }

    // submit the query, and get back an iterator over matching features
    FeatureSource featureSource = dataStore.getFeatureSource(simpleFeatureTypeName);
    FeatureIterator featureItr = featureSource.getFeatures(query).features();

    // loop through all results
    while (featureItr.hasNext()) {
        Feature feature = featureItr.next();
        StringBuilder sb = new StringBuilder();
        sb.append("Feature ID ").append(feature.getIdentifier());

        for (String field : attributeFields) {
            sb.append(" | ").append(field).append(": ").append(feature.getProperty(field).getValue());
        }
        System.out.println(sb.toString());
    }
    featureItr.close();
}
 
开发者ID:geomesa,项目名称:geomesa-tutorials,代码行数:40,代码来源:AccumuloQuickStart.java


示例14: testNaturalSortingAsc

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
@Test
public void testNaturalSortingAsc() throws Exception {
    init();
    Query q = new Query(featureSource.getSchema().getTypeName());
    q.setSortBy(new SortBy[] { SortBy.NATURAL_ORDER });
    SimpleFeatureIterator features = featureSource.getFeatures(q).features();
    String prevId = null;
    while (features.hasNext()) {
        String currId = features.next().getID();
        if (prevId != null)
            assertTrue(prevId.compareTo(currId) <= 0);
        prevId = currId;
    }
    features.close();
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:16,代码来源:ElasticFeatureFilterIT.java


示例15: testNaturalSortingDesc

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
@Test
public void testNaturalSortingDesc() throws Exception {
    init();
    Query q = new Query(featureSource.getSchema().getTypeName());
    q.setSortBy(new SortBy[] { SortBy.REVERSE_ORDER });
    SimpleFeatureIterator features = featureSource.getFeatures(q).features();
    String prevId = null;
    while (features.hasNext()) {
        String currId = features.next().getID();
        if (prevId != null)
            assertTrue(prevId.compareTo(currId) >= 0);
        prevId = currId;
    }
    features.close();
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:16,代码来源:ElasticFeatureFilterIT.java


示例16: sortCollection

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
/**
 * sort the features so no wider polygon covers a smaller polygon.
 * 
 * @param inCollection
 * @return
 */
private SimpleFeatureCollection sortCollection(final SimpleFeatureCollection inCollection) {
	// seems as the sorting does not work with doubles, so this is sorting the indirect way by using the agg_count
	// instead
	SortBy sortBy = CommonFactoryFinder.getFilterFactory().sort(AGG_COUNT_ATTRIBUTE_NAME,
               SortOrder.DESCENDING);
	SimpleFeatureCollection sortedOutputCollection = inCollection.sort(sortBy);
	return sortedOutputCollection;
}
 
开发者ID:geops,项目名称:trafimage-geoserver-transformations,代码行数:15,代码来源:AggregateSimilarLinesAsPolygonsProcess.java


示例17: supportsSorting

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
@Override
public boolean supportsSorting(
		final SortBy[] sortAttributes ) {
	// called for every WFS-T operation. Without sorting requests, the
	// argument is empty or null
	// returning false fails the operation, disabling any capability of
	// writing.
	return sortAttributes == null || sortAttributes.length == 0;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:10,代码来源:GeoWaveQueryCaps.java


示例18: prepareSearchRequest

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
private ElasticRequest prepareSearchRequest(Query query, boolean scroll) throws IOException {
    String naturalSortOrder = SortOrder.ASCENDING.toSQL().toLowerCase();
    final ElasticRequest searchRequest = new ElasticRequest();
    final ElasticDataStore dataStore = getDataStore();
    final String docType = dataStore.getDocType(entry.getName());

    LOGGER.fine("Preparing " + docType + " (" + entry.getName() + ") query");
    if (!scroll) {
        if (query.getSortBy()!=null){
            for (final SortBy sort : query.getSortBy()) {
                final String sortOrder = sort.getSortOrder().toSQL().toLowerCase();
                if (sort.getPropertyName() != null) {
                    final String name = sort.getPropertyName().getPropertyName();
                    searchRequest.addSort(name, sortOrder);
                } else {
                    naturalSortOrder = sortOrder;
                }
            }
        }

        // pagination
        searchRequest.setSize(getSize(query));
        searchRequest.setFrom(getStartIndex(query));
    } else {
        if (dataStore.getScrollSize() != null) {
            searchRequest.setSize(dataStore.getScrollSize().intValue());
        }
        if (dataStore.getScrollTime() != null) {
            searchRequest.setScroll(dataStore.getScrollTime());
        }
    }

    if (dataStore.isSourceFilteringEnabled()) {
        // add source includes
        setSourceIncludes(searchRequest);
    }

    // add query and post filter
    final FilterToElastic filterToElastic = new FilterToElastic();
    filterToElastic.setFeatureType(buildFeatureType());
    filterToElastic.encode(query);
    filterFullySupported = filterToElastic.getFullySupported();
    if (!filterFullySupported) {
        LOGGER.fine("Filter is not fully supported by native Elasticsearch."
                + " Additional post-query filtering will be performed.");
    }
    final Map<String,Object> queryBuilder = filterToElastic.getQueryBuilder();

    final Map<String,Object> nativeQueryBuilder = filterToElastic.getNativeQueryBuilder();

    searchRequest.setQuery(queryBuilder);

    if (isSort(query) && nativeQueryBuilder.equals(ElasticConstants.MATCH_ALL)) {
        searchRequest.addSort("_uid", naturalSortOrder);
    }

    if (filterToElastic.getAggregations() != null) {
        final Map<String, Map<String, Map<String, Object>>> aggregations = filterToElastic.getAggregations();
        final Envelope envelope = (Envelope) query.getFilter().accept(ExtractBoundsFilterVisitor.BOUNDS_VISITOR, null);
        final long gridSize;
        if (dataStore.getGridSize() != null) {
            gridSize = dataStore.getGridSize();
        } else {
            gridSize = (Long) ElasticDataStoreFactory.GRID_SIZE.getDefaultValue();
        }
        final double gridThreshold;
        if (dataStore.getGridThreshold() != null) {
            gridThreshold = dataStore.getGridThreshold();
        } else {
            gridThreshold = (Double) ElasticDataStoreFactory.GRID_THRESHOLD.getDefaultValue();
        }
        final int precision = GeohashUtil.computePrecision(envelope, gridSize, gridThreshold);
        LOGGER.fine("Updating GeoHash grid aggregation precision to " + precision);
        GeohashUtil.updateGridAggregationPrecision(aggregations, precision);
        searchRequest.setAggregations(aggregations);
        searchRequest.setSize(0);
    }

    return searchRequest;
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:81,代码来源:ElasticFeatureSource.java


示例19: testGetFeaturesWithSort

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
@Test
public void testGetFeaturesWithSort() throws Exception {
    init();
    FilterFactory ff = dataStore.getFilterFactory();
    SortBy sort = ff.sort("vendor_s", SortOrder.ASCENDING);
    Query query = new Query();
    query.setSortBy(new SortBy[] { sort });

    SimpleFeatureCollection features = featureSource.getFeatures(query);
    assertEquals(11, features.size());

    SimpleFeatureIterator iterator = features.features();
    SimpleFeature f;
    try {
        assertTrue(iterator.hasNext());
        f = iterator.next();
        assertEquals("Asus", f.getAttribute("vendor_s"));
        assertTrue(iterator.hasNext());
        f = iterator.next();
        assertEquals("Cisco", f.getAttribute("vendor_s"));
        assertTrue(iterator.hasNext());
        f = iterator.next();
        assertEquals("Cisco", f.getAttribute("vendor_s"));
    } finally {
        iterator.close();
    }

    sort = ff.sort("vendor_s", SortOrder.DESCENDING);
    query.setSortBy(new SortBy[] { sort });
    features = featureSource.getFeatures(query);
    iterator = features.features();
    try {
        assertTrue(iterator.hasNext());
        f = iterator.next();
        assertEquals("TP-Link", f.getAttribute("vendor_s"));
        assertTrue(iterator.hasNext());
        f = iterator.next();
        assertEquals("Linksys", f.getAttribute("vendor_s"));
        assertTrue(iterator.hasNext());
        f = iterator.next();
        assertEquals("Linksys", f.getAttribute("vendor_s"));
    } finally {
        iterator.close();
    }
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:46,代码来源:ElasticFeatureFilterIT.java


示例20: isAscendingSortOrder

import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
/**
 * Checks if is ascending sort order.
 *
 * @param obj the obj
 * @return the boolean
 */
private static Boolean isAscendingSortOrder(SortBy obj) {
    return (obj.getSortOrder().name().compareTo(SortOrder.ASCENDING.name()) == 0);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:10,代码来源:SortByTableModel.java



注:本文中的org.opengis.filter.sort.SortBy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java StepDebugMeta类代码示例发布时间:2022-05-22
下一篇:
Java ColumnMetaData类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap