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


Java Long2ObjectOpenHashMap.containsKey方法代碼示例

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


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


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