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


Java THashSet.addAll方法代码示例

本文整理汇总了Java中gnu.trove.set.hash.THashSet.addAll方法的典型用法代码示例。如果您正苦于以下问题:Java THashSet.addAll方法的具体用法?Java THashSet.addAll怎么用?Java THashSet.addAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gnu.trove.set.hash.THashSet的用法示例。


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

示例1: merge

import gnu.trove.set.hash.THashSet; //导入方法依赖的package包/类
private void merge(int pos, int id) {
    THashSet<String> posSet = hashlist.get(pos);
    THashSet<String> idSet = clusterHashList.get(id);
    idSet.addAll(posSet);
    ArrayList<String> list = clusterResult.get(id);
    list.add(word.get(pos));
}
 
开发者ID:FudanNLP,项目名称:fnlp,代码行数:8,代码来源:WordSimilarity.java

示例2: initclusterResult

import gnu.trove.set.hash.THashSet; //导入方法依赖的package包/类
private void initclusterResult(int size) {
    for (int i = 0; i < size; i++) {
        ArrayList<String> list = new ArrayList<String>();
        list.add(word.get(i));
        clusterResult.add(list);
        THashSet<String> thashset = new THashSet<String>();
        thashset.addAll(hashlist.get(i));
        clusterHashList.add(thashset);
    }
}
 
开发者ID:FudanNLP,项目名称:fnlp,代码行数:11,代码来源:WordSimilarity.java

示例3: nextSeeds

import gnu.trove.set.hash.THashSet; //导入方法依赖的package包/类
private Stack<Seed> nextSeeds(int currentRHSIndex) {
//		System.out.println("Find holes");
		THashSet<ColumnCollection> deps = new THashSet<>();
		ArrayList<ColumnCollection> currentMaximalNonDependencies = maximalNonDependencies.getLHSForRHS(currentRHSIndex);
		HashSet<ColumnCollection> currentMinimalDependencies = new HashSet<>(minimalDependencies.getLHSForRHS(currentRHSIndex));
		ArrayList<ColumnCollection> newDeps = new ArrayList<>(numberOfColumns * deps.size());
//		Holes holes = new Holes();
		
//		int i = 0;
//		for (ColumnCollection maximalNonDependency : currentMaximalNonDependencies) {
//			ColumnCollection complement = maximalNonDependency.setCopy(currentRHSIndex).complement();
//			if (deps.isEmpty()) {
//				ColumnCollection emptyColumnIndices = new ColumnCollection(numberOfColumns);
//				for (Integer complementColumnIndex : complement.getSetBits()) {
//					deps.add(emptyColumnIndices.setCopy(complementColumnIndex));
//				}
//			} else {
//				for (ColumnCollection dep : deps) {
//					int[] setBits = complement.getSetBits();
//					for (int setBit = 0; setBit < setBits.length; setBit++) {
//						holes.add(dep.setCopy(setBits[setBit]));
////						System.out.println("Dep:\t" + dep.setCopy(setBits[setBit]));
//					}
//				}
//				// minimize newDeps
//				System.out.println(i++ + "\t" + currentMaximalNonDependencies.size());
//				System.out.println("total deps:\t" + deps.size());
//				System.out.println("before minimizing:\t" + holes.size());
////				ArrayList<ColumnCollection> minimizedNewDeps = minimizeSeeds(newDeps);
//				holes.minimize();
//				System.out.println("after minimizing:\t" + holes.size());
//				deps.clear();
//				deps.addAll(holes);
//				holes.clear();
//			}
//		}

		for (ColumnCollection maximalNonDependency : currentMaximalNonDependencies) {
			ColumnCollection complement = maximalNonDependency.setCopy(currentRHSIndex).complement();
			if (deps.isEmpty()) {
				ColumnCollection emptyColumnIndices = new ColumnCollection(numberOfColumns);
				for (Integer complementColumnIndex : complement.getSetBits()) {
					deps.add(emptyColumnIndices.setCopy(complementColumnIndex));
				}
			} else {
				for (ColumnCollection dep : deps) {
					int[] setBits = complement.getSetBits();
					for (int setBit = 0; setBit < setBits.length; setBit++) {
						newDeps.add(dep.setCopy(setBits[setBit]));
					}
				}
				// minimize newDeps
				ArrayList<ColumnCollection> minimizedNewDeps = minimizeSeeds(newDeps);
				deps.clear();
				deps.addAll(minimizedNewDeps);
				newDeps.clear();
			}
		}
		
		// return only elements that aren't already covered by the minimal
		// dependencies
		Stack<Seed> remainingSeeds = new Stack<>();
		deps.removeAll(currentMinimalDependencies);
		for (ColumnCollection remainingSeed : deps) {
			remainingSeeds.push(new Seed(remainingSeed));
		}

		return remainingSeeds;
	}
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:70,代码来源:DFDMiner.java


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