本文整理汇总了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++;
}
}
示例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++;
}
}
示例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++;
}
}
示例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++;
}
}