Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for peekingIterator (0.18 sec)

  1. 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)
  2. 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)
  3. 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)
  4. android/guava-testlib/src/com/google/common/testing/ArbitraryInstances.java

              // All collections are immutable empty. So safe for any type parameter.
              .put(Iterator.class, ImmutableSet.of().iterator())
              .put(PeekingIterator.class, Iterators.peekingIterator(ImmutableSet.of().iterator()))
              .put(ListIterator.class, ImmutableList.of().listIterator())
              .put(Iterable.class, ImmutableSet.of())
              .put(Collection.class, ImmutableList.of())
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 20.8K bytes
    - Viewed (0)
  5. guava-testlib/src/com/google/common/testing/ArbitraryInstances.java

              // All collections are immutable empty. So safe for any type parameter.
              .put(Iterator.class, ImmutableSet.of().iterator())
              .put(PeekingIterator.class, Iterators.peekingIterator(ImmutableSet.of().iterator()))
              .put(ListIterator.class, ImmutableList.of().listIterator())
              .put(Iterable.class, ImmutableSet.of())
              .put(Collection.class, ImmutableList.of())
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 21.2K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/package-info.java

     *
     * <h2>Other</h2>
     *
     * <ul>
     *   <li>{@link EvictingQueue}
     *   <li>{@link Interner}, {@link Interners}
     *   <li>{@link MapMaker}
     *   <li>{@link MinMaxPriorityQueue}
     *   <li>{@link PeekingIterator}
     * </ul>
     */
    @CheckReturnValue
    @ParametersAreNonnullByDefault
    package com.google.common.collect;
    
    import com.google.errorprone.annotations.CheckReturnValue;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Jul 06 16:29:45 UTC 2023
    - 5K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/package-info.java

     *
     * <h2>Other</h2>
     *
     * <ul>
     *   <li>{@link EvictingQueue}
     *   <li>{@link Interner}, {@link Interners}
     *   <li>{@link MapMaker}
     *   <li>{@link MinMaxPriorityQueue}
     *   <li>{@link PeekingIterator}
     * </ul>
     */
    @CheckReturnValue
    @ParametersAreNonnullByDefault
    package com.google.common.collect;
    
    import com.google.errorprone.annotations.CheckReturnValue;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Jul 06 16:29:45 UTC 2023
    - 5K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. 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)
Back to top