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


Java IntObjectMap类代码示例

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


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

示例1: doFetch

import com.carrotsearch.hppc.IntObjectMap; //导入依赖的package包/类
public IntObjectMap<StreamBucket> doFetch(
        FetchContext fetchContext, IntObjectMap<IntContainer> toFetch) throws Exception {

    IntObjectHashMap<StreamBucket> fetched = new IntObjectHashMap<>(toFetch.size());
    HashMap<TableIdent, TableFetchInfo> tableFetchInfos = getTableFetchInfos(fetchContext);

    for (IntObjectCursor<IntContainer> toFetchCursor : toFetch) {
        TableIdent ident = fetchContext.tableIdent(toFetchCursor.key);
        TableFetchInfo tfi = tableFetchInfos.get(ident);
        assert tfi != null;
        StreamBucket.Builder builder = new StreamBucket.Builder(tfi.streamers());
        tfi.createCollector(toFetchCursor.key).collect(toFetchCursor.value, builder);
        fetched.put(toFetchCursor.key, builder.build());
    }
    return fetched;

}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:18,代码来源:NodeFetchOperation.java

示例2: execute

import com.carrotsearch.hppc.IntObjectMap; //导入依赖的package包/类
public void execute(String targetNode,
                    final IntObjectMap<Streamer[]> streamers,
                    final NodeFetchRequest request,
                    ActionListener<NodeFetchResponse> listener) {
    transports.sendRequest(TRANSPORT_ACTION, targetNode, request, listener,
            new DefaultTransportResponseHandler<NodeFetchResponse>(listener, RESPONSE_EXECUTOR) {
                @Override
                public NodeFetchResponse newInstance() {
                    return NodeFetchResponse.forReceiveing(streamers);
                }
            });
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:13,代码来源:TransportFetchNodeAction.java

示例3: setDestinationEdge

import com.carrotsearch.hppc.IntObjectMap; //导入依赖的package包/类
public void setDestinationEdge(EdgeIteratorState edge, Graph graph, FlagEncoder encoder, TraversalMode tMode)
{
	if (edge != null)
	{
		int nodeId = edge.getBaseNode();
		if (nodeId != -1)
		{
			mode = MODE_DESTINATION_EDGES;
			Weighting weighting = new FastestWeighting(encoder);
			CustomDijkstra dijkstraAlg = new CustomDijkstra(graph, encoder, weighting, tMode);
			EdgeFilter edgeFilter = this;
			dijkstraAlg.setEdgeFilter(edgeFilter);
			dijkstraAlg.calcPath(nodeId, Integer.MIN_VALUE);

			IntObjectMap<SPTEntry> destination = dijkstraAlg.getMap();

			destinationEdges = new ArrayList<Integer>(destination.size());
			for (IntObjectCursor<SPTEntry> ee : destination) {
				if (!destinationEdges.contains(ee.value.edge)) // was originalEdge
					destinationEdges.add(ee.value.edge);
			}

			if (!destinationEdges.contains(edge.getOriginalEdge()))
			{
				int vt = gsHeavyVehicles.getEdgeVehicleType(edge.getOriginalEdge(), buffer);
				boolean dstFlag = buffer[1]!=0;// ((buffer[1] >> (vehicleType >> 1)) & 1) == 1;

				if (((vt & vehicleType) == vehicleType) && (dstFlag))
					destinationEdges.add(edge.getOriginalEdge());
			}

			if (destinationEdges.size() == 0)
				destinationEdges = null;
		}
	}

	mode = MODE_ROUTE;
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:39,代码来源:HeavyVehicleEdgeFilter.java

示例4: generate

import com.carrotsearch.hppc.IntObjectMap; //导入依赖的package包/类
@Override
public ConcatVectorNamespace generate(SourceOfRandomness sourceOfRandomness, GenerationStatus generationStatus) {
    ConcatVectorNamespace namespace = new ConcatVectorNamespace();
    namespace.featureToIndex.putAll(generateFeatureMap(sourceOfRandomness));
    for (ObjectCursor<String> key : namespace.featureToIndex.keys()) {
        if (sourceOfRandomness.nextBoolean()) {
            ObjectIntMap<String> sparseMap = generateFeatureMap(sourceOfRandomness);
            IntObjectMap< String> reverseSparseMap = new IntObjectHashMap<>();
            for (ObjectCursor<String> sparseKey : sparseMap.keys()) reverseSparseMap.put(sparseMap.get(sparseKey.value), sparseKey.value);
            namespace.sparseFeatureIndex.put(key.value, sparseMap);
            namespace.reverseSparseFeatureIndex.put(key.value, reverseSparseMap);
        }
    }
    return namespace;
}
 
开发者ID:keenon,项目名称:loglinear,代码行数:16,代码来源:ConcatVectorNamespaceTest.java

示例5: forSending

import com.carrotsearch.hppc.IntObjectMap; //导入依赖的package包/类
public static NodeFetchResponse forSending(IntObjectMap<StreamBucket> fetched){
    return new NodeFetchResponse(null, fetched);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:4,代码来源:NodeFetchResponse.java

示例6: forReceiveing

import com.carrotsearch.hppc.IntObjectMap; //导入依赖的package包/类
public static NodeFetchResponse forReceiveing(@Nullable IntObjectMap<Streamer[]> streamers){
    return new NodeFetchResponse(streamers, null);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:4,代码来源:NodeFetchResponse.java

示例7: NodeFetchResponse

import com.carrotsearch.hppc.IntObjectMap; //导入依赖的package包/类
private NodeFetchResponse(@Nullable IntObjectMap<Streamer[]> streamers,
                          @Nullable IntObjectMap<StreamBucket> fetched) {
    this.streamers = streamers;
    this.fetched = fetched;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:6,代码来源:NodeFetchResponse.java

示例8: fetched

import com.carrotsearch.hppc.IntObjectMap; //导入依赖的package包/类
@Nullable
public IntObjectMap<StreamBucket> fetched() {
    return fetched;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:5,代码来源:NodeFetchResponse.java

示例9: AccessibilityMap

import com.carrotsearch.hppc.IntObjectMap; //导入依赖的package包/类
public AccessibilityMap(IntObjectMap<SPTEntry> map, SPTEntry edgeEntry)
{
	this.map = map;
	this.edgeEntry = edgeEntry;
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:6,代码来源:AccessibilityMap.java

示例10: getMap

import com.carrotsearch.hppc.IntObjectMap; //导入依赖的package包/类
public IntObjectMap<SPTEntry> getMap()
{
	return map;
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:5,代码来源:AccessibilityMap.java

示例11: getMap

import com.carrotsearch.hppc.IntObjectMap; //导入依赖的package包/类
public IntObjectMap<SPTEntry> getMap()
{
	return fromMap;
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:5,代码来源:HeavyVehicleEdgeFilter.java

示例12: fillEdgesUpward

import com.carrotsearch.hppc.IntObjectMap; //导入依赖的package包/类
private void fillEdgesUpward(MultiTreeSPEntry currEdge, PriorityQueue<MultiTreeSPEntry> prioQueue,
		IntObjectMap<MultiTreeSPEntry> shortestWeightMap, EdgeExplorer explorer) {
	EdgeIterator iter = explorer.setBaseNode(currEdge.adjNode);

	if (iter == null) // we reach one of the target nodes
		return;

	_upwardEdgeFilter.setBaseNode(currEdge.adjNode);

	while (iter.next()) {
		if (!_upwardEdgeFilter.accept(iter))
			continue;
		
		_upwardEdgeFilter.updateHighestNode(iter);
		
		_edgeWeight = _weighting.calcWeight(iter, false, 0);

		if (!Double.isInfinite(_edgeWeight)) {
			MultiTreeSPEntry ee = shortestWeightMap.get(iter.getAdjNode());

			if (ee == null) {
				ee = new MultiTreeSPEntry(iter.getAdjNode(), iter.getEdge(), _edgeWeight, true, currEdge, currEdge.getSize());

				shortestWeightMap.put(iter.getAdjNode(), ee);
				prioQueue.add(ee);
			} else {
				_addToQueue = false;
				
				for (int i = 0; i < _treeEntrySize; ++i) {
					_msptItem = currEdge.getItem(i);
					_entryWeight = _msptItem.weight;
					
					if (_entryWeight == 0.0)
						continue;

					_msptSubItem = ee.getItem(i);

					if (_msptItem.update == false) {
	//					upwardItersSkipped++;
						continue;
					}
					
					_tmpWeight = _edgeWeight + _entryWeight;

					if (_msptSubItem.weight > _tmpWeight || _msptSubItem.weight == 0.0) {
						_msptSubItem.weight = _tmpWeight;
						_msptSubItem.edge = iter.getEdge();
						_msptSubItem.parent = currEdge;
						_msptSubItem.update = true;
						
						_addToQueue = true;
	//					upwardIters++;

					} //else
	//					upwardItersTotal++;
				}

				if (_addToQueue) {
					ee.updateWeights();
					prioQueue.remove(ee);
					prioQueue.add(ee);
				}
			}
		}
	}
	
	currEdge.resetUpdate(false);
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:69,代码来源:RPHASTAlgorithm.java

示例13: fillEdgesDownward

import com.carrotsearch.hppc.IntObjectMap; //导入依赖的package包/类
private void fillEdgesDownward(MultiTreeSPEntry currEdge, PriorityQueue<MultiTreeSPEntry> prioQueue,
		IntObjectMap<MultiTreeSPEntry> shortestWeightMap, EdgeExplorer explorer) {

	EdgeIterator iter = explorer.setBaseNode(currEdge.adjNode);

	if (iter == null)
		return;

	while (iter.next()) {
		_edgeWeight = _weighting.calcWeight(iter, false, 0);

		if (!Double.isInfinite(_edgeWeight)) {
			MultiTreeSPEntry ee = shortestWeightMap.get(iter.getAdjNode());

			if (ee == null) {
				ee = new MultiTreeSPEntry(iter.getAdjNode(), iter.getEdge(), _edgeWeight, true, currEdge, currEdge.getSize());
				ee.visited = true;

				shortestWeightMap.put(iter.getAdjNode(), ee);
				prioQueue.add(ee);
			} else {
				_addToQueue = false;
				
				for (int i = 0; i < _treeEntrySize; ++i) {
					_msptItem = currEdge.getItem(i);
					_entryWeight = _msptItem.weight;
					
					if (_entryWeight == 0.0)
						continue;

					if (_msptItem.update == false) {
	//					downwardItersSkipped++;
						continue;
					}

					_tmpWeight = _edgeWeight + _entryWeight;

					MultiTreeSPEntryItem eeItem = ee.getItem(i);

					if (eeItem.weight > _tmpWeight || eeItem.weight == 0.0) {
						eeItem.weight = _tmpWeight;
						eeItem.edge = iter.getEdge();
						eeItem.parent = currEdge;
						eeItem.update = true;
						
						_addToQueue = true;
	//					downwardIters++;
					} //else
					//	downwardItersTotal++;
				}
				
				ee.updateWeights();
				
				if (ee.visited == false) {
					// // This is the case if the node has been assigned a
					// weight in
					// // the upwards pass (fillEdges). We need to use it in
					// the
					// // downwards pass to access lower level nodes, though
					// the
					// weight
					// // does not have to be reset necessarily //
					ee.visited = true;
					ee.resetUpdate(true);
					prioQueue.add(ee);
				} else if (_addToQueue) {
					ee.visited = true;
					prioQueue.remove(ee);
					prioQueue.add(ee);
				}
			}
		}
	}
	
	currEdge.resetUpdate(false);
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:77,代码来源:RPHASTAlgorithm.java

示例14: getGroups

import com.carrotsearch.hppc.IntObjectMap; //导入依赖的package包/类
public IntObjectMap<Collector> getGroups() {
  return this.groups;
}
 
开发者ID:europeana,项目名称:search,代码行数:4,代码来源:ExpandComponent.java


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