org.broadinstitute.gatk.utils.Utils.xor()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.2k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中org.broadinstitute.gatk.utils.Utils.xor()方法的一些代码示例,展示了Utils.xor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.xor()方法的具体详情如下:
包路径:org.broadinstitute.gatk.utils.Utils
类名称:Utils
方法名:xor

Utils.xor介绍

[英]Boolean xor operation. Only true if x != y.
[中]布尔异或运算。只有当x=Y

代码示例

代码示例来源:origin: broadgsa/gatk-protected

public CalledHaplotypes(final List<VariantContext> calls, final Set<Haplotype> calledHaplotypes) {
  if ( calls == null ) throw new IllegalArgumentException("calls cannot be null");
  if ( calledHaplotypes == null ) throw new IllegalArgumentException("calledHaplotypes cannot be null");
  if ( Utils.xor(calls.isEmpty(), calledHaplotypes.isEmpty()) )
    throw new IllegalArgumentException("Calls and calledHaplotypes should both be empty or both not but got calls=" + calls + " calledHaplotypes=" + calledHaplotypes);
  this.calls = calls;
  this.calledHaplotypes = calledHaplotypes;
}

代码示例来源:origin: broadgsa/gatk

@Test
public void testXor() {
  Assert.assertEquals(Utils.xor(false, false), false, "xor F F failed");
  Assert.assertEquals(Utils.xor(false, true), true, "xor F T failed");
  Assert.assertEquals(Utils.xor(true, false), true, "xor T F failed");
  Assert.assertEquals(Utils.xor(true, true), false, "xor T T failed");
}

相关文章