- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for PeekingIterator (0.14 sec)
-
android/guava-tests/test/com/google/common/collect/PeekingIteratorTest.java
Iterator<?> iterator = list.iterator(); PeekingIterator<?> peekingIterator = Iterators.peekingIterator(iterator); assertThrows(NoSuchElementException.class, () -> peekingIterator.peek()); } public void testPeekDoesntChangeIteration() { List<?> list = Lists.newArrayList("A", "B", "C"); Iterator<?> iterator = list.iterator(); PeekingIterator<?> peekingIterator = Iterators.peekingIterator(iterator);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 8.6K bytes - Viewed (0) -
guava-tests/test/com/google/common/collect/PeekingIteratorTest.java
Iterator<?> iterator = list.iterator(); PeekingIterator<?> peekingIterator = Iterators.peekingIterator(iterator); assertThrows(NoSuchElementException.class, () -> peekingIterator.peek()); } public void testPeekDoesntChangeIteration() { List<?> list = Lists.newArrayList("A", "B", "C"); Iterator<?> iterator = list.iterator(); PeekingIterator<?> peekingIterator = Iterators.peekingIterator(iterator);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 8.6K bytes - Viewed (0) -
android/guava/src/com/google/common/collect/Iterators.java
* String a1 = peekingIterator.peek(); // returns "a" * String a2 = peekingIterator.peek(); // also returns "a" * String a3 = peekingIterator.next(); // also returns "a" * }</pre> * * <p>Any structural changes to the underlying iteration (aside from those performed by the * iterator's own {@link PeekingIterator#remove()} method) will leave the iterator in an undefined * state.
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 50.3K bytes - Viewed (0) -
guava-tests/test/com/google/common/collect/IteratorsTest.java
Iterator<String> nonpeek = Lists.newArrayList("a", "b", "c").iterator(); PeekingIterator<String> peek = Iterators.peekingIterator(nonpeek); assertNotSame(peek, nonpeek); assertSame(peek, Iterators.peekingIterator(peek)); assertSame(peek, Iterators.peekingIterator((Iterator<String>) peek)); }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 54.1K bytes - Viewed (0) -
guava/src/com/google/common/collect/ImmutableRangeSet.java
ImmutableList.Builder<Range<C>> mergedRangesBuilder = new ImmutableList.Builder<>(ranges.size()); sort(ranges, Range.<C>rangeLexOrdering()); PeekingIterator<Range<C>> peekingItr = Iterators.peekingIterator(ranges.iterator()); while (peekingItr.hasNext()) { Range<C> range = peekingItr.next(); while (peekingItr.hasNext()) { Range<C> nextRange = peekingItr.peek();
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 27K bytes - Viewed (0) -
guava/src/com/google/common/collect/TreeTraverser.java
return new BreadthFirstIterator(root); } }; } private final class BreadthFirstIterator extends UnmodifiableIterator<T> implements PeekingIterator<T> { private final Queue<T> queue; BreadthFirstIterator(T root) { this.queue = new ArrayDeque<>(); queue.add(root); } @Override public boolean hasNext() {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 8.9K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/collect/IteratorsTest.java
Iterator<String> nonpeek = Lists.newArrayList("a", "b", "c").iterator(); PeekingIterator<String> peek = Iterators.peekingIterator(nonpeek); assertNotSame(peek, nonpeek); assertSame(peek, Iterators.peekingIterator(peek)); assertSame(peek, Iterators.peekingIterator((Iterator<String>) peek)); }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 54.1K bytes - Viewed (0)