當前位置: 首頁>>代碼示例>>Java>>正文


Java Long2ObjectOpenHashMap.put方法代碼示例

本文整理匯總了Java中it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap.put方法的典型用法代碼示例。如果您正苦於以下問題:Java Long2ObjectOpenHashMap.put方法的具體用法?Java Long2ObjectOpenHashMap.put怎麽用?Java Long2ObjectOpenHashMap.put使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap的用法示例。


在下文中一共展示了Long2ObjectOpenHashMap.put方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: checkAndStore

import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; //導入方法依賴的package包/類
protected <T> void checkAndStore(long entityId, Class<? super T> type) {
	if (isTransaction) {
		LongOpenHashSet entityAdded = added.get(type);
		if (entityAdded.contains(entityId)) 
			return;
		
		T oldT = repository.get((Class<T>)type, entityId);
		Long2ObjectOpenHashMap<Object> data = snapshotted.get(type);
		
		if (oldT == null) {
			entityAdded.add(entityId);
		} else if (!data.containsKey(entityId)) {
			data.put(entityId, oldT);
		}
	}
}
 
開發者ID:dmart28,項目名稱:reveno,代碼行數:17,代碼來源:SnapshotBasedModelRepository.java

示例2: readFieldsForPartition

import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; //導入方法依賴的package包/類
@Override
public void readFieldsForPartition(DataInput in,
    int partitionId) throws IOException {
  int size = in.readInt();
  Long2ObjectOpenHashMap<DataInputOutput> partitionMap =
      new Long2ObjectOpenHashMap<DataInputOutput>(size);
  while (size-- > 0) {
    long vertexId = in.readLong();
    DataInputOutput dataInputOutput = config.createMessagesInputOutput();
    dataInputOutput.readFields(in);
    partitionMap.put(vertexId, dataInputOutput);
  }
  synchronized (map) {
    map.put(partitionId, partitionMap);
  }
}
 
開發者ID:renato2099,項目名稱:giraph-gora,代碼行數:17,代碼來源:LongByteArrayMessageStore.java

示例3: purgeIntersectingClusterEntries

import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; //導入方法依賴的package包/類
protected Long2ObjectOpenHashMap<LongArrayList> purgeIntersectingClusterEntries(
    Long2ObjectOpenHashMap<LongArrayList> result) {
  Long2ObjectOpenHashMap<LongArrayList> purgedResult = new Long2ObjectOpenHashMap<>();
  Iterator<Long> resultIterator = result.keySet().iterator();
  while (resultIterator.hasNext()) {
    long uniqueCluster = resultIterator.next();
    if (result.get(uniqueCluster).size() != 1) {
      purgedResult.put(uniqueCluster, result.get(uniqueCluster));
    }
  }
  return purgedResult;
}
 
開發者ID:HPI-Information-Systems,項目名稱:metanome-algorithms,代碼行數:13,代碼來源:OrConditionTraverser.java

示例4: synchronizedLong2ObjectOpenHashMapCopy

import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; //導入方法依賴的package包/類
@Benchmark
public Long2ObjectOpenHashMap synchronizedLong2ObjectOpenHashMapCopy(Context context) {
	Long2ObjectOpenHashMap<Object> map = new Long2ObjectOpenHashMap<>();
	
	synchronized (map) {
		//Populate the map the first time
		for (int i = 0; i < context.testValues.length; i++)
			map.put(context.testKeys[i], context.testValues[i]);
		
		//Copy!
		Long2ObjectOpenHashMap<Object> copy = map.clone();
		return copy;
	}
}
 
開發者ID:austinv11,項目名稱:Long-Map-Benchmarks,代碼行數:15,代碼來源:MapTests.java

示例5: getDataInputOutput

import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; //導入方法依賴的package包/類
/**
 * Get the DataInputOutput for a vertex id, creating if necessary.
 *
 * @param partitionMap Partition map to look in
 * @param vertexId Id of the vertex
 * @return DataInputOutput for this vertex id (created if necessary)
 */
private DataInputOutput getDataInputOutput(
    Long2ObjectOpenHashMap<DataInputOutput> partitionMap,
    long vertexId) {
  DataInputOutput dataInputOutput = partitionMap.get(vertexId);
  if (dataInputOutput == null) {
    dataInputOutput = config.createMessagesInputOutput();
    partitionMap.put(vertexId, dataInputOutput);
  }
  return dataInputOutput;
}
 
開發者ID:renato2099,項目名稱:giraph-gora,代碼行數:18,代碼來源:LongByteArrayMessageStore.java

示例6: combineClusterIntoResult

import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; //導入方法依賴的package包/類
protected void combineClusterIntoResult(ColumnCombinationBitset partialUnique)
    throws AlgorithmExecutionException {
  LongArrayList touchedCluster = new LongArrayList();
  Long2LongOpenHashMap partialUniqueHash = this.algorithm.getPLI(partialUnique).asHashMap();
  Set<ColumnCombinationBitset> startPoints = this.getConditionStartPoints();
  for (ColumnCombinationBitset minimalConditionStartPoint : startPoints) {
    if (minimalConditionStartPoint.getSetBits().size() != 1) {
      minimalConditionStartPoint =
          minimalConditionStartPoint.getContainedOneColumnCombinations().get(0);
    }

    List<ConditionEntry> satisfiedCluster = new ArrayList<>();
    Long2ObjectOpenHashMap<LongArrayList> intersectingCluster = new Long2ObjectOpenHashMap<>();
    int clusterNumber = 0;
    //build intersecting cluster
    for (ConditionEntry singleCluster : this.singleConditions.get(minimalConditionStartPoint)) {
      satisfiedCluster.add(singleCluster.setClusterNumber(clusterNumber));
      touchedCluster.clear();
      for (long rowNumber : singleCluster.cluster) {
        if (partialUniqueHash.containsKey(rowNumber)) {
          touchedCluster.add(partialUniqueHash.get(rowNumber));
        }
      }
      for (long partialUniqueClusterNumber : touchedCluster) {
        if (intersectingCluster.containsKey(partialUniqueClusterNumber)) {
          intersectingCluster.get(partialUniqueClusterNumber).add(clusterNumber);
        } else {
          LongArrayList newConditionClusterNumbers = new LongArrayList();
          newConditionClusterNumbers.add(clusterNumber);
          intersectingCluster.put(partialUniqueClusterNumber, newConditionClusterNumbers);
        }
      }
      clusterNumber++;
    }
    intersectingCluster = purgeIntersectingClusterEntries(intersectingCluster);
    //convert into list
    List<LongArrayList> intersectingClusterList = new ArrayList<>();
    for (long partialUniqueCluster : intersectingCluster.keySet()) {
      intersectingClusterList.add(intersectingCluster.get(partialUniqueCluster));
    }

    Object2FloatArrayMap<List<ConditionEntry>>
        clustergroups =
        this.combineClusters(this.algorithm.frequency, satisfiedCluster,
                             intersectingClusterList);

    for (List<ConditionEntry> singleCondition : clustergroups.keySet()) {
      ResultSingleton.getInstance().addConditionToResult(partialUnique, singleCondition,
                                                         clustergroups.get(singleCondition));
    }
  }
}
 
開發者ID:HPI-Information-Systems,項目名稱:metanome-algorithms,代碼行數:53,代碼來源:OrConditionTraverser.java

示例7: addOrUpdateDelegate

import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; //導入方法依賴的package包/類
/**
 * Should be called by devices during {@link IDevice#onConnect()}
 * or whenever a connected device adds or changes a block. 
 * Tracks the device block so that it is discoverable.<p>
 * 
 * Does NOT form connections or notify neighbors of the new block. 
 * The caller is responsible for doing so.  Done this way
 * because some device blocks are inherently unable to 
 * form connections or are entirely contained within other
 * blocks owned by the same device.<p>
 * 
 * DOES notify old block of removal if a block was already present.
 * In this case, the old block is responsible for handling
 * tear down of existing connections, notifying neighbors, etc.
 * 
 */
public void addOrUpdateDelegate(@Nonnull IDeviceBlock block)
{
    if(Configurator.logDeviceChanges)
        Log.info("DeviceWorldManager.addOrUpdateDelegate: " + block.description());
    
    Long2ObjectOpenHashMap<IDeviceBlock> blocks = this.getBlocksForDimension(block.dimensionID());
    synchronized(blocks)
    {
        IDeviceBlock oldBlock = blocks.put(block.packedBlockPos(), block);
        if(oldBlock != null) oldBlock.onRemoval();
    }
}
 
開發者ID:grondag,項目名稱:Hard-Science,代碼行數:29,代碼來源:DeviceWorldManager.java


注:本文中的it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap.put方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。