Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 30 for computeNext (0.07 sec)

  1. guava-tests/test/com/google/common/base/AbstractIteratorTest.java

        // Make sure computeNext() doesn't get invoked again
        assertFalse(iter.hasNext());
    
        assertThrows(NoSuchElementException.class, iter::next);
      }
    
      public void testSneakyThrow() throws Exception {
        Iterator<Integer> iter =
            new AbstractIterator<Integer>() {
              boolean haveBeenCalled;
    
              @Override
              public Integer computeNext() {
                if (haveBeenCalled) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Sep 17 18:14:12 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  2. guava/src/com/google/common/collect/AbstractIterator.java

       *     IllegalStateException}.
       */
      @CheckForNull
      protected abstract T computeNext();
    
      /**
       * Implementations of {@link #computeNext} <b>must</b> invoke this method when there are no
       * elements left in the iteration.
       *
       * @return {@code null}; a convenience so your {@code computeNext} implementation can use the
       *     simple statement {@code return endOfData();}
       */
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Mar 18 02:04:10 UTC 2022
    - 6.4K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/collect/AbstractIteratorTest.java

        // second, then signals that it's reached the end of the data
        Iterator<Integer> iter =
            new AbstractIterator<Integer>() {
              private int rep;
    
              @Override
              public @Nullable Integer computeNext() {
                switch (rep++) {
                  case 0:
                    return 0;
                  case 1:
                    return 1;
                  case 2:
                    return endOfData();
                  default:
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Oct 15 17:36:06 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/collect/AbstractIteratorTest.java

        // second, then signals that it's reached the end of the data
        Iterator<Integer> iter =
            new AbstractIterator<Integer>() {
              private int rep;
    
              @Override
              public @Nullable Integer computeNext() {
                switch (rep++) {
                  case 0:
                    return 0;
                  case 1:
                    return 1;
                  case 2:
                    return endOfData();
                  default:
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Oct 15 17:36:06 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  5. guava/src/com/google/common/base/AbstractIterator.java

      protected AbstractIterator() {}
    
      private enum State {
        READY,
        NOT_READY,
        DONE,
        FAILED,
      }
    
      @CheckForNull private T next;
    
      @CheckForNull
      protected abstract T computeNext();
    
      @CanIgnoreReturnValue
      @CheckForNull
      protected final T endOfData() {
        state = State.DONE;
        return null;
      }
    
      @Override
      public final boolean hasNext() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Jul 09 17:31:04 UTC 2021
    - 2.5K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/graph/DirectedGraphConnections.java

              Set<N> seenNodes = new HashSet<>();
              return new AbstractIterator<N>() {
                @Override
                @CheckForNull
                protected N computeNext() {
                  while (nodeConnections.hasNext()) {
                    NodeConnection<N> nodeConnection = nodeConnections.next();
                    boolean added = seenNodes.add(nodeConnection.node);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Feb 20 17:00:05 UTC 2024
    - 18K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/ConsumingQueueIterator.java

      private final Queue<T> queue;
    
      ConsumingQueueIterator(Queue<T> queue) {
        this.queue = checkNotNull(queue);
      }
    
      @Override
      @CheckForNull
      protected T computeNext() {
        // TODO(b/192579700): Use a ternary once it no longer confuses our nullness checker.
        if (queue.isEmpty()) {
          return endOfData();
        }
        return queue.remove();
      }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Jan 21 14:48:03 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  8. guava/src/com/google/common/graph/EndpointPairIterator.java

      private static final class Directed<N> extends EndpointPairIterator<N> {
        private Directed(BaseGraph<N> graph) {
          super(graph);
        }
    
        @Override
        @CheckForNull
        protected EndpointPair<N> computeNext() {
          while (true) {
            if (successorIterator.hasNext()) {
              // requireNonNull is safe because successorIterator is empty until we set this.node.
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Jul 09 17:31:04 UTC 2021
    - 5K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/collect/RegularContiguousSet.java

      }
    
      @Override
      public UnmodifiableIterator<C> iterator() {
        return new AbstractSequentialIterator<C>(first()) {
          final C last = last();
    
          @Override
          @CheckForNull
          protected C computeNext(C previous) {
            return equalsOrThrow(previous, last) ? null : domain.next(previous);
          }
        };
      }
    
      @GwtIncompatible // NavigableSet
      @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Feb 22 21:19:52 UTC 2024
    - 8.4K bytes
    - Viewed (0)
  10. guava/src/com/google/common/graph/MultiEdgesConnecting.java

      public UnmodifiableIterator<E> iterator() {
        Iterator<? extends Entry<E, ?>> entries = outEdgeToNode.entrySet().iterator();
        return new AbstractIterator<E>() {
          @Override
          @CheckForNull
          protected E computeNext() {
            while (entries.hasNext()) {
              Entry<E, ?> entry = entries.next();
              if (targetNode.equals(entry.getValue())) {
                return entry.getKey();
              }
            }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 06 00:47:57 UTC 2021
    - 2.2K bytes
    - Viewed (0)
Back to top