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


Java ImmutableMultiset.of方法代码示例

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


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

示例1: equals

import com.google.common.collect.ImmutableMultiset; //导入方法依赖的package包/类
/**
 * Returns true iff the other object is an instance of {@code TagContext} and contains the same
 * key-value pairs. Implementations are free to override this method to provide better
 * performance.
 */
@Override
public boolean equals(@Nullable Object other) {
  if (!(other instanceof TagContext)) {
    return false;
  }
  TagContext otherTags = (TagContext) other;
  Iterator<Tag> iter1 = getIterator();
  Iterator<Tag> iter2 = otherTags.getIterator();
  Multiset<Tag> tags1 =
      iter1 == null
          ? ImmutableMultiset.<Tag>of()
          : HashMultiset.create(Lists.<Tag>newArrayList(iter1));
  Multiset<Tag> tags2 =
      iter2 == null
          ? ImmutableMultiset.<Tag>of()
          : HashMultiset.create(Lists.<Tag>newArrayList(iter2));
  return tags1.equals(tags2);
}
 
开发者ID:census-instrumentation,项目名称:opencensus-java,代码行数:24,代码来源:TagContext.java

示例2: testGetIdentifier

import com.google.common.collect.ImmutableMultiset; //导入方法依赖的package包/类
@Test
public void testGetIdentifier() throws Exception {
    MathTag tagX = new MathTag(1, "<math xmlns=\"http://www.w3.org/1998/Math/MathML\"><mrow><mi>x</mi></mrow></math>", WikiTextUtils.MathMarkUpType.MATHML);
    assertEquals(ImmutableSet.of("x"), tagX.getIdentifier(true, true).elementSet());
    assertEquals(ImmutableSet.of("x"), tagX.getIdentifier(false, true).elementSet());
    MathTag schrödinger = new MathTag(1, getTestResource("com/formulasearchengine/mathosphere/mlp/schrödinger_eq.xml"), WikiTextUtils.MathMarkUpType.MATHML);
    //MathTag schrödingerTex = new MathTag(1,"i\\hbar\\frac{\\partial}{\\partial t}\\Psi(\\mathbb{r},\\,t)=-\\frac{\\hbar^{2}}{2m}" +
    //  "\\nabla^{2}\\Psi(\\mathbb{r},\\,t)+V(\\mathbb{r})\\Psi(\\mathbb{r},\\,t).", WikiTextUtils.MathMarkUpType.LATEX);
    ImmutableMultiset<String> lIds = ImmutableMultiset.of("i",
            "\\hbar", "\\hbar",
            "t", "t", "t", "t",
            "\\Psi", "\\Psi", "\\Psi",
            "\\mathbb{r}", "\\mathbb{r}", "\\mathbb{r}", "\\mathbb{r}",
            "V",
            "m");
    assertEquals(lIds, schrödinger.getIdentifier(true, false));
}
 
开发者ID:ag-gipp,项目名称:mathosphere,代码行数:18,代码来源:MathTagTest.java

示例3: testTransform

import com.google.common.collect.ImmutableMultiset; //导入方法依赖的package包/类
@Test
public void testTransform()
{
	List<String> lines = Arrays.asList("#Comment line", "#Another comment line",
			"11\t47359281\t.\tC\tG\t.\t.\tCADD_SCALED=33.0", "11\t47359281\tC\tCC\t2.3\t33.0",
			"11\t47359281\t.\tC\tCG\t.\t.\tCADD_SCALED=33.0", "11\t47359281\t.\tCG\tC\t.\t.\tCADD_SCALED=33.0");

	Multiset<LineType> expected = ImmutableMultiset.of(COMMENT, COMMENT, VCF, CADD, INDEL_NOCADD, INDEL_NOCADD);
	Assert.assertEquals(lineParser.transformLines(lines.stream(), output, error), expected);

	verify(output).accept("##fileformat=VCFv4.0");
	verify(output).accept("#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO");
	verify(output).accept("11\t47359281\t.\tC\tG\t.\t.\t.");
	verify(output).accept("11\t47359281\t.\tC\tCC\t.\t.\tCADD=2.3;CADD_SCALED=33.0");
	verify(error).accept("Line 5:\t11\t47359281\t.\tC\tCG\t.\t.\tCADD_SCALED=33.0");
	verify(error).accept("Line 6:\t11\t47359281\t.\tCG\tC\t.\t.\tCADD_SCALED=33.0");
}
 
开发者ID:molgenis,项目名称:molgenis,代码行数:18,代码来源:ParserTest.java

示例4: getByComponentKey

import com.google.common.collect.ImmutableMultiset; //导入方法依赖的package包/类
Multiset<IssueKey> getByComponentKey(String componentKey) {
  Multiset<IssueKey> issueKeys = getPrevious().get(componentKey);
  if (issueKeys == null) {
    issueKeys = ImmutableMultiset.of();
  }
  return issueKeys;
}
 
开发者ID:SonarSource,项目名称:sonar-lits,代码行数:8,代码来源:IssuesChecker.java

示例5: testRunHappyPathVcf

import com.google.common.collect.ImmutableMultiset; //导入方法依赖的package包/类
@Test
public void testRunHappyPathVcf() throws Exception
{
	final ImmutableMultiset<LineType> lineTypes = ImmutableMultiset.of(COMMENT, COMMENT, VCF, VCF);
	when(parser.tryTransform(inputFile, processedInputFile, errorFile)).thenReturn(lineTypes);

	job.call(progress);

	verify(progress).setProgressMax(5);
	verify(progress).progress(0, "Preprocessing input file...");

	verify(progress).progress(1, "Annotating with cadd...");
	verify(annotatorRunner).runAnnotator(cadd, processedInputFile, caddResult, true);

	verify(progress).progress(2, "Annotating with exac...");
	verify(annotatorRunner).runAnnotator(exac, caddResult, exacResult, true);

	verify(progress).progress(3, "Annotating with snpEff...");
	verify(annotatorRunner).runAnnotator(snpeff, exacResult, snpEffResult, false);

	verify(progress).progress(4, "Annotating with gavin...");
	verify(annotatorRunner).runAnnotator(gavin, snpEffResult, gavinResult, false);

	verify(progress).progress(5, "Result is ready for download.");
	verify(progress).setResultUrl("/menu/plugins/gavin-app/result/ABCDE");

	verify(gavinJobExecution).setLineTypes(lineTypes);
}
 
开发者ID:molgenis,项目名称:molgenis,代码行数:29,代码来源:GavinJobTest.java

示例6: generateImmutableMultiset

import com.google.common.collect.ImmutableMultiset; //导入方法依赖的package包/类
@Generates private static <E> ImmutableMultiset<E> generateImmutableMultiset(E freshElement) {
  return ImmutableMultiset.of(freshElement);
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:4,代码来源:FreshValueGenerator.java

示例7: getAssignedNameCounts

import com.google.common.collect.ImmutableMultiset; //导入方法依赖的package包/类
@Override
public Multiset<String> getAssignedNameCounts() {
  return ImmutableMultiset.of();
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:5,代码来源:FunctionTypeBuilder.java

示例8: generateImmutableMultiset

import com.google.common.collect.ImmutableMultiset; //导入方法依赖的package包/类
@Generates
private static <E> ImmutableMultiset<E> generateImmutableMultiset(E freshElement) {
  return ImmutableMultiset.of(freshElement);
}
 
开发者ID:google,项目名称:guava,代码行数:5,代码来源:FreshValueGenerator.java

示例9: emptyMultiset

import com.google.common.collect.ImmutableMultiset; //导入方法依赖的package包/类
public static <E> ImmutableMultiset<E> emptyMultiset() { return ImmutableMultiset.of(); } 
开发者ID:orionll,项目名称:guava-factory,代码行数:2,代码来源:Factory.java

示例10: multiset

import com.google.common.collect.ImmutableMultiset; //导入方法依赖的package包/类
public static <E> ImmutableMultiset<E> multiset(E element) { return ImmutableMultiset.of(element); } 
开发者ID:orionll,项目名称:guava-factory,代码行数:2,代码来源:Factory.java


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