本文整理汇总了Java中com.google.common.collect.ImmutableSortedMultiset类的典型用法代码示例。如果您正苦于以下问题:Java ImmutableSortedMultiset类的具体用法?Java ImmutableSortedMultiset怎么用?Java ImmutableSortedMultiset使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ImmutableSortedMultiset类属于com.google.common.collect包,在下文中一共展示了ImmutableSortedMultiset类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: resultsMatch
import com.google.common.collect.ImmutableSortedMultiset; //导入依赖的package包/类
private static boolean resultsMatch(QueryResult controlResult, QueryResult testResult, int precision)
{
SortedMultiset<List<Object>> control = ImmutableSortedMultiset.copyOf(rowComparator(precision), controlResult.getResults());
SortedMultiset<List<Object>> test = ImmutableSortedMultiset.copyOf(rowComparator(precision), testResult.getResults());
try {
return control.equals(test);
}
catch (TypesDoNotMatchException e) {
return false;
}
}
开发者ID:y-lan,项目名称:presto,代码行数:12,代码来源:Validator.java
示例2: getResultsComparison
import com.google.common.collect.ImmutableSortedMultiset; //导入依赖的package包/类
public String getResultsComparison(int precision)
{
List<List<Object>> controlResults = controlResult.getResults();
List<List<Object>> testResults = testResult.getResults();
if (valid() || (controlResults == null) || (testResults == null)) {
return "";
}
Multiset<List<Object>> control = ImmutableSortedMultiset.copyOf(rowComparator(precision), controlResults);
Multiset<List<Object>> test = ImmutableSortedMultiset.copyOf(rowComparator(precision), testResults);
try {
Iterable<ChangedRow> diff = ImmutableSortedMultiset.<ChangedRow>naturalOrder()
.addAll(Iterables.transform(Multisets.difference(control, test), row -> new ChangedRow(Changed.REMOVED, row, precision)))
.addAll(Iterables.transform(Multisets.difference(test, control), row -> new ChangedRow(Changed.ADDED, row, precision)))
.build();
diff = Iterables.limit(diff, 100);
StringBuilder sb = new StringBuilder();
sb.append(format("Control %s rows, Test %s rows%n", control.size(), test.size()));
if (verboseResultsComparison) {
Joiner.on("\n").appendTo(sb, diff);
}
else {
sb.append("RESULTS DO NOT MATCH\n");
}
return sb.toString();
}
catch (TypesDoNotMatchException e) {
return e.getMessage();
}
}
开发者ID:y-lan,项目名称:presto,代码行数:36,代码来源:Validator.java
示例3: testToImmutableSortedMultiset
import com.google.common.collect.ImmutableSortedMultiset; //导入依赖的package包/类
@Test
public void testToImmutableSortedMultiset() throws Exception {
ImmutableSortedMultiset<String> multiset = Stream.of("b", "c", "a", "a", "b", "a", "a", "f")
.collect(MoreCollectors.toImmutableSortedMultiset());
assertThat(multiset.size()).isEqualTo(8);
assertThat(multiset.count("a")).isEqualTo(4);
assertThat(multiset.count("b")).isEqualTo(2);
assertThat(multiset.elementSet()).containsExactly("a", "b", "c", "f");
}
开发者ID:yanaga,项目名称:guava-stream,代码行数:10,代码来源:MoreCollectorsTest.java
示例4: testToImmutableSortedMultisetWithComparator
import com.google.common.collect.ImmutableSortedMultiset; //导入依赖的package包/类
@Test
public void testToImmutableSortedMultisetWithComparator() throws Exception {
ImmutableSortedMultiset<String> multiset = Stream.of("b", "c", "a", "a", "b", "a", "a", "f")
.collect(MoreCollectors.toImmutableSortedMultiset((a, b) -> b.compareTo(a)));
assertThat(multiset.size()).isEqualTo(8);
assertThat(multiset.count("a")).isEqualTo(4);
assertThat(multiset.count("b")).isEqualTo(2);
assertThat(multiset.elementSet()).containsExactly("f", "c", "b", "a");
}
开发者ID:yanaga,项目名称:guava-stream,代码行数:10,代码来源:MoreCollectorsTest.java
示例5: getElemMultiset
import com.google.common.collect.ImmutableSortedMultiset; //导入依赖的package包/类
@Value.ReverseOrder
ImmutableSortedMultiset<Elem> getElemMultiset();
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:3,代码来源:SortedCollectionWrapper.java
示例6: getImmutableElemMultiset
import com.google.common.collect.ImmutableSortedMultiset; //导入依赖的package包/类
@Value.ReverseOrder
ImmutableSortedMultiset<ImmutableElem> getImmutableElemMultiset();
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:3,代码来源:SortedCollectionWrapper.java
示例7: generateImmutableSortedMultiset
import com.google.common.collect.ImmutableSortedMultiset; //导入依赖的package包/类
@Generates private static <E extends Comparable<E>> ImmutableSortedMultiset<E>
generateImmutableSortedMultiset(E freshElement) {
return ImmutableSortedMultiset.of(freshElement);
}
开发者ID:zugzug90,项目名称:guava-mock,代码行数:5,代码来源:FreshValueGenerator.java
示例8: testImmutableSortedMultiset
import com.google.common.collect.ImmutableSortedMultiset; //导入依赖的package包/类
public void testImmutableSortedMultiset() {
assertFreshInstance(new TypeToken<ImmutableSortedMultiset<String>>() {});
}
开发者ID:zugzug90,项目名称:guava-mock,代码行数:4,代码来源:FreshValueGeneratorTest.java
示例9: toImmutableSortedMultiset
import com.google.common.collect.ImmutableSortedMultiset; //导入依赖的package包/类
public static <T extends Comparable<T>> Collector<T, ?, ImmutableSortedMultiset<T>> toImmutableSortedMultiset() {
return toImmutableSortedMultiset(Comparator.<T>naturalOrder());
}
开发者ID:yanaga,项目名称:guava-stream,代码行数:4,代码来源:MoreCollectors.java
示例10: generateImmutableSortedMultiset
import com.google.common.collect.ImmutableSortedMultiset; //导入依赖的package包/类
@Generates
private static <E extends Comparable<E>>
ImmutableSortedMultiset<E> generateImmutableSortedMultiset(E freshElement) {
return ImmutableSortedMultiset.of(freshElement);
}
开发者ID:google,项目名称:guava,代码行数:6,代码来源:FreshValueGenerator.java
示例11: VariantAnnotations
import com.google.common.collect.ImmutableSortedMultiset; //导入依赖的package包/类
/**
* Construct ImmutableAnnotationList from a {@link Collection} of {@link Annotation} objects.
*
* Note that <code>variant</code> is converted to the forward strand using {@link GenomeVariant#withStrand}.
*
* @param variant
* {@link GenomeVariant} that this anotation list annotates
* @param entries
* {@link Collection} of {@link Annotation} objects
*/
public VariantAnnotations(GenomeVariant variant, Collection<Annotation> entries) {
this.change = variant.withStrand(Strand.FWD);
this.entries = ImmutableList.copyOf(ImmutableSortedMultiset.copyOf(entries));
}
开发者ID:charite,项目名称:jannovar,代码行数:15,代码来源:VariantAnnotations.java
示例12: emptySortedMultiset
import com.google.common.collect.ImmutableSortedMultiset; //导入依赖的package包/类
public static <E> ImmutableSortedMultiset<E> emptySortedMultiset() { return ImmutableSortedMultiset.of(); }
开发者ID:orionll,项目名称:guava-factory,代码行数:2,代码来源:Factory.java
示例13: sortedMultiset
import com.google.common.collect.ImmutableSortedMultiset; //导入依赖的package包/类
public static <E extends Comparable<? super E>> ImmutableSortedMultiset<E> sortedMultiset(E element) { return ImmutableSortedMultiset.of(element); }
开发者ID:orionll,项目名称:guava-factory,代码行数:2,代码来源:Factory.java
注:本文中的com.google.common.collect.ImmutableSortedMultiset类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论