Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for peekingIterator (0.13 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. 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)
  7. 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)
  8. 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)
  9. android/guava-testlib/test/com/google/common/testing/ArbitraryInstancesTest.java

    import com.google.common.collect.ListMultimap;
    import com.google.common.collect.MapDifference;
    import com.google.common.collect.Multimap;
    import com.google.common.collect.Multiset;
    import com.google.common.collect.PeekingIterator;
    import com.google.common.collect.Range;
    import com.google.common.collect.RowSortedTable;
    import com.google.common.collect.SetMultimap;
    import com.google.common.collect.SortedMapDifference;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 21.8K bytes
    - Viewed (0)
  10. 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)
Back to top