本文整理汇总了Java中java.util.Spliterator.DISTINCT属性的典型用法代码示例。如果您正苦于以下问题:Java Spliterator.DISTINCT属性的具体用法?Java Spliterator.DISTINCT怎么用?Java Spliterator.DISTINCT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.util.Spliterator
的用法示例。
在下文中一共展示了Spliterator.DISTINCT属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: characteristics
@Override
public int characteristics() {
if (beforeSplit) {
// Concatenation loses DISTINCT and SORTED characteristics
return aSpliterator.characteristics() & bSpliterator.characteristics()
& ~(Spliterator.DISTINCT | Spliterator.SORTED
| (unsized ? Spliterator.SIZED | Spliterator.SUBSIZED : 0));
}
else {
return bSpliterator.characteristics();
}
}
示例2: characteristics
public int characteristics() {
return Spliterator.DISTINCT | Spliterator.ORDERED;
}
示例3: characteristics
public int characteristics() {
return Spliterator.DISTINCT | Spliterator.SORTED |
Spliterator.ORDERED | Spliterator.CONCURRENT |
Spliterator.NONNULL;
}
示例4: characteristics
public int characteristics() {
return Spliterator.DISTINCT | Spliterator.CONCURRENT |
Spliterator.NONNULL;
}
示例5: characteristics
public int characteristics() {
return (side == 0 ? Spliterator.SIZED : 0) |
Spliterator.DISTINCT | Spliterator.SORTED | Spliterator.ORDERED;
}
示例6: characteristics
@Override
public int characteristics() {
return Spliterator.ORDERED | Spliterator.SIZED | Spliterator.SUBSIZED |
Spliterator.IMMUTABLE | Spliterator.NONNULL |
Spliterator.DISTINCT | Spliterator.SORTED;
}
示例7: filter
/** Returns a {@code Spliterator} filtered by the specified predicate. */
static <T> Spliterator<T> filter(Spliterator<T> fromSpliterator, Predicate<? super T> predicate) {
checkNotNull(fromSpliterator);
checkNotNull(predicate);
class Splitr implements Spliterator<T>, Consumer<T> {
T holder = null;
@Override
public void accept(T t) {
this.holder = t;
}
@Override
public boolean tryAdvance(Consumer<? super T> action) {
while (fromSpliterator.tryAdvance(this)) {
try {
if (predicate.test(holder)) {
action.accept(holder);
return true;
}
} finally {
holder = null;
}
}
return false;
}
@Override
public Spliterator<T> trySplit() {
Spliterator<T> fromSplit = fromSpliterator.trySplit();
return (fromSplit == null) ? null : filter(fromSplit, predicate);
}
@Override
public long estimateSize() {
return fromSpliterator.estimateSize() / 2;
}
@Override
public Comparator<? super T> getComparator() {
return fromSpliterator.getComparator();
}
@Override
public int characteristics() {
return fromSpliterator.characteristics()
& (Spliterator.DISTINCT
| Spliterator.NONNULL
| Spliterator.ORDERED
| Spliterator.SORTED);
}
}
return new Splitr();
}
示例8: characteristics
@Override
public int characteristics() {
return Spliterator.DISTINCT | Spliterator.NONNULL | Spliterator.ORDERED;
}
示例9: characteristics
public int characteristics() {
return Spliterator.DISTINCT | Spliterator.ORDERED |
Spliterator.SORTED;
}
示例10: characteristics
@Override
public int characteristics() {
return (s.characteristics() & ~(Spliterator.SIZED | Spliterator.SUBSIZED |
Spliterator.SORTED | Spliterator.ORDERED))
| Spliterator.DISTINCT;
}