當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。