当前位置: 首页>>代码示例>>Java>>正文


Java TShortIntProcedure类代码示例

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


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

示例1: optimizePoiOrdering

import gnu.trove.procedure.TShortIntProcedure; //导入依赖的package包/类
/**
 * @param histogram a histogram that represents the frequencies of tags
 */
public void optimizePoiOrdering(TShortIntHashMap histogram) {
    this.optimizedPoiIds.clear();
    final TreeSet<HistogramEntry> poiOrdering = new TreeSet<>();

    histogram.forEachEntry(new TShortIntProcedure() {
        @Override
        public boolean execute(short tag, int amount) {
            poiOrdering.add(new HistogramEntry(tag, amount));
            return true;
        }
    });

    short tmpPoiID = 0;

    CB_OSMTag currentTag = null;
    for (HistogramEntry histogramEntry : poiOrdering.descendingSet()) {
        currentTag = this.idToPoiTag.get(Short.valueOf(histogramEntry.id));
        this.optimizedPoiIds.put(Short.valueOf(histogramEntry.id), Short.valueOf(tmpPoiID));
        LOGGER.finer("adding poi tag: " + currentTag.tagKey() + " id:" + tmpPoiID + " amount: "
                + histogramEntry.amount);
        tmpPoiID++;
    }
}
 
开发者ID:Longri,项目名称:CB_MAP,代码行数:27,代码来源:CB_OSMTagMapping.java

示例2: optimizeWayOrdering

import gnu.trove.procedure.TShortIntProcedure; //导入依赖的package包/类
/**
 * @param histogram a histogram that represents the frequencies of tags
 */
public void optimizeWayOrdering(TShortIntHashMap histogram) {
    this.optimizedWayIds.clear();
    final TreeSet<HistogramEntry> wayOrdering = new TreeSet<>();

    histogram.forEachEntry(new TShortIntProcedure() {
        @Override
        public boolean execute(short tag, int amount) {
            wayOrdering.add(new HistogramEntry(tag, amount));
            return true;
        }
    });
    short tmpWayID = 0;

    CB_OSMTag currentTag = null;
    for (HistogramEntry histogramEntry : wayOrdering.descendingSet()) {
        currentTag = this.idToWayTag.get(Short.valueOf(histogramEntry.id));
        this.optimizedWayIds.put(Short.valueOf(histogramEntry.id), Short.valueOf(tmpWayID));
        LOGGER.finer("adding way tag: " + currentTag.tagKey() + " id:" + tmpWayID + " amount: "
                + histogramEntry.amount);
        tmpWayID++;
    }
}
 
开发者ID:Longri,项目名称:CB_MAP,代码行数:26,代码来源:CB_OSMTagMapping.java

示例3: optimizePoiOrdering

import gnu.trove.procedure.TShortIntProcedure; //导入依赖的package包/类
/**
 * @param histogram
 *            a histogram that represents the frequencies of tags
 */
public void optimizePoiOrdering(TShortIntHashMap histogram) {
	this.optimizedPoiIds.clear();
	final TreeSet<HistogramEntry> poiOrdering = new TreeSet<OSMTagMapping.HistogramEntry>();

	histogram.forEachEntry(new TShortIntProcedure() {
		@Override
		public boolean execute(short tag, int amount) {
			poiOrdering.add(new HistogramEntry(tag, amount));
			return true;
		}
	});

	short tmpPoiID = 0;

	OSMTag currentTag = null;
	for (HistogramEntry histogramEntry : poiOrdering.descendingSet()) {
		currentTag = this.idToPoiTag.get(Short.valueOf(histogramEntry.id));
		this.optimizedPoiIds.put(Short.valueOf(histogramEntry.id), Short.valueOf(tmpPoiID));
		LOGGER.finer("adding poi tag: " + currentTag.tagKey() + " id:" + tmpPoiID + " amount: "
				+ histogramEntry.amount);
		tmpPoiID++;
	}
}
 
开发者ID:DonTomika,项目名称:mapsforge,代码行数:28,代码来源:OSMTagMapping.java

示例4: optimizeWayOrdering

import gnu.trove.procedure.TShortIntProcedure; //导入依赖的package包/类
/**
 * @param histogram
 *            a histogram that represents the frequencies of tags
 */
public void optimizeWayOrdering(TShortIntHashMap histogram) {
	this.optimizedWayIds.clear();
	final TreeSet<HistogramEntry> wayOrdering = new TreeSet<OSMTagMapping.HistogramEntry>();

	histogram.forEachEntry(new TShortIntProcedure() {
		@Override
		public boolean execute(short tag, int amount) {
			wayOrdering.add(new HistogramEntry(tag, amount));
			return true;
		}
	});
	short tmpWayID = 0;

	OSMTag currentTag = null;
	for (HistogramEntry histogramEntry : wayOrdering.descendingSet()) {
		currentTag = this.idToWayTag.get(Short.valueOf(histogramEntry.id));
		this.optimizedWayIds.put(Short.valueOf(histogramEntry.id), Short.valueOf(tmpWayID));
		LOGGER.finer("adding way tag: " + currentTag.tagKey() + " id:" + tmpWayID + " amount: "
				+ histogramEntry.amount);
		tmpWayID++;
	}
}
 
开发者ID:DonTomika,项目名称:mapsforge,代码行数:27,代码来源:OSMTagMapping.java


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