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


Java Sets.symmetricDifference方法代码示例

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


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

示例1: open

import com.google.common.collect.Sets; //导入方法依赖的package包/类
public static SystemOutputStore2016 open(File dir) throws IOException {
  final Symbol systemID = Symbol.from(dir.getName());
  final File argumentsDir = new File(dir, "arguments");
  final File linkingDir = new File(dir, "linking");
  final File corpusLinkingFile = new File(new File(dir, "corpusLinking"), "corpusLinking");
  corpusLinkingFile.getParentFile().mkdirs();

  final ArgumentStore argStore = AssessmentSpecFormats.openSystemOutputStore(argumentsDir,
      AssessmentSpecFormats.Format.KBP2015);
  final LinkingStore linkingStore =
      LinkingStoreSource.createFor2016().openLinkingStore(linkingDir);
  if (argStore.docIDs().equals(linkingStore.docIDs())) {
    return new SystemOutputStore2016(systemID, argStore, linkingStore, corpusLinkingFile);
  } else {
    throw new RuntimeException("Argument and linking store docIDs do not match, missing " + Sets
        .symmetricDifference(argStore.docIDs(), linkingStore.docIDs()));
  }
}
 
开发者ID:isi-nlp,项目名称:tac-kbp-eal,代码行数:19,代码来源:SystemOutputStore2016.java

示例2: openOrCreate

import com.google.common.collect.Sets; //导入方法依赖的package包/类
public static SystemOutputStore2016 openOrCreate(File dir) throws IOException {
  final Symbol systemID = Symbol.from(dir.getName());
  final File argumentsDir = new File(dir, "arguments");
  final File linkingDir = new File(dir, "linking");
  final File corpusLinkingFile = new File(new File(dir, "corpusLinking"), "corpusLinking");
  corpusLinkingFile.getParentFile().mkdirs();

  final ArgumentStore argStore = AssessmentSpecFormats.openOrCreateSystemOutputStore(argumentsDir,
      AssessmentSpecFormats.Format.KBP2015);
  final LinkingStore linkingStore =
      LinkingStoreSource.createFor2016().openOrCreateLinkingStore(linkingDir);
  if (argStore.docIDs().equals(linkingStore.docIDs())) {
    return new SystemOutputStore2016(systemID, argStore, linkingStore, corpusLinkingFile);
  } else {
    throw new RuntimeException("Argument and linking store docIDs do not match, missing " + Sets
        .symmetricDifference(argStore.docIDs(), linkingStore.docIDs()));
  }
}
 
开发者ID:isi-nlp,项目名称:tac-kbp-eal,代码行数:19,代码来源:SystemOutputStore2016.java

示例3: bevatParentobjectGroepenMetRecordsZonderIndMutLev

import com.google.common.collect.Sets; //导入方法依赖的package包/类
private boolean bevatParentobjectGroepenMetRecordsZonderIndMutLev(final MetaRecord metaRecord) {
    final MetaObject parentObject = metaRecord.getParentGroep().getParentObject();
    final Set<MetaGroep> overigeGroepen = Sets.symmetricDifference(parentObject.getGroepen(), Sets.newHashSet(metaRecord.getParentGroep()));
    for (final MetaGroep metaGroep : overigeGroepen) {
        for (final MetaRecord record : metaGroep.getRecords()) {
            if (record.isIndicatieTbvLeveringMutaties() == null || !record.isIndicatieTbvLeveringMutaties()) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:13,代码来源:OpschonenTavIndMutLevServiceImpl.java

示例4: diff

import com.google.common.collect.Sets; //导入方法依赖的package包/类
public static List<Set<String>> diff(HeaderGroup expected, HeaderGroup actual) {
	Set<String> expecetdKeys = keys(expected);
	Set<String> actualKeys = keys(actual);
	Set<String> common = Sets.intersection(expecetdKeys, actualKeys);
	Set<String> symdiff = Sets.symmetricDifference(expecetdKeys, actualKeys);
	Set<String> diffval = new HashSet<>();
	for (String s : common)
		if (! expected.getCondensedHeader(s).getValue().equals(actual.getCondensedHeader(s).getValue())) diffval.add(s);
	return Arrays.asList(diffval, symdiff);
}
 
开发者ID:LAW-Unimi,项目名称:BUbiNG,代码行数:11,代码来源:InputStreamTestMocks.java

示例5: disjointView

import com.google.common.collect.Sets; //导入方法依赖的package包/类
/**
 * set1, set2的补集(在set1或set2中,但不在交集中的对象,又叫反交集)的只读view,不复制产生新的Set对象.
 * 
 * 如果尝试写入该View会抛出UnsupportedOperationException
 */
public static <E> Set<E> disjointView(final Set<? extends E> set1, final Set<? extends E> set2) {
	return Sets.symmetricDifference(set1, set2);
}
 
开发者ID:zhangjunfang,项目名称:util,代码行数:9,代码来源:SetUtil.java


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