本文整理匯總了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); }