本文整理汇总了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);
}
示例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));
}
示例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");
}
示例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;
}
示例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);
}
示例6: generateImmutableMultiset
import com.google.common.collect.ImmutableMultiset; //导入方法依赖的package包/类
@Generates private static <E> ImmutableMultiset<E> generateImmutableMultiset(E freshElement) {
return ImmutableMultiset.of(freshElement);
}
示例7: getAssignedNameCounts
import com.google.common.collect.ImmutableMultiset; //导入方法依赖的package包/类
@Override
public Multiset<String> getAssignedNameCounts() {
return ImmutableMultiset.of();
}
示例8: generateImmutableMultiset
import com.google.common.collect.ImmutableMultiset; //导入方法依赖的package包/类
@Generates
private static <E> ImmutableMultiset<E> generateImmutableMultiset(E freshElement) {
return ImmutableMultiset.of(freshElement);
}
示例9: emptyMultiset
import com.google.common.collect.ImmutableMultiset; //导入方法依赖的package包/类
public static <E> ImmutableMultiset<E> emptyMultiset() { return ImmutableMultiset.of(); }
示例10: multiset
import com.google.common.collect.ImmutableMultiset; //导入方法依赖的package包/类
public static <E> ImmutableMultiset<E> multiset(E element) { return ImmutableMultiset.of(element); }