Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 43 for cycle (0.16 sec)

  1. android/guava-tests/test/com/google/common/collect/IterablesTest.java

        assertEquals(expected, actual);
      }
    
      // Far less exhaustive than the tests in IteratorsTest
      public void testCycle() {
        Iterable<String> cycle = Iterables.cycle("a", "b");
    
        int howManyChecked = 0;
        for (String string : cycle) {
          String expected = (howManyChecked % 2 == 0) ? "a" : "b";
          assertEquals(expected, string);
          if (howManyChecked++ == 5) {
            break;
          }
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 46K bytes
    - Viewed (0)
  2. guava-testlib/src/com/google/common/collect/testing/Helpers.java

              }
    
              @Override
              public void remove() {
                listIter.remove();
              }
            };
          }
        };
      }
    
      static <T extends @Nullable Object> Iterator<T> cycle(Iterable<T> iterable) {
        return new Iterator<T>() {
          Iterator<T> iterator = Collections.<T>emptySet().iterator();
    
          @Override
          public boolean hasNext() {
            return true;
          }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Feb 26 19:46:10 GMT 2024
    - 17.7K bytes
    - Viewed (0)
  3. guava/src/com/google/common/collect/Iterators.java

       * should use an explicit {@code break} or be certain that you will eventually remove all the
       * elements.
       */
      @SafeVarargs
      public static <T extends @Nullable Object> Iterator<T> cycle(T... elements) {
        return cycle(Lists.newArrayList(elements));
      }
    
      /**
       * Returns an Iterator that walks the specified array, nulling out elements behind it. This can
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Tue Jan 30 00:14:39 GMT 2024
    - 50.5K bytes
    - Viewed (0)
  4. android/guava-testlib/src/com/google/common/collect/testing/AbstractIteratorTester.java

        stimuli = (Stimulus<E, ? super I>[]) new Stimulus<?, ?>[steps];
        if (!elementsToInsertIterable.iterator().hasNext()) {
          throw new IllegalArgumentException();
        }
        elementsToInsert = Helpers.cycle(elementsToInsertIterable);
        this.features = Helpers.copyToSet(features);
        this.expectedElements = Helpers.copyToList(expectedElements);
        this.knownOrder = knownOrder;
        this.startIndex = startIndex;
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 20.7K bytes
    - Viewed (0)
  5. guava/src/com/google/common/collect/FluentIterable.java

       * use {@code Stream.generate(() -> collection).flatMap(Collection::stream)}.
       */
      public final FluentIterable<E> cycle() {
        return from(Iterables.cycle(getDelegate()));
      }
    
      /**
       * Returns a fluent iterable whose iterators traverse first the elements of this fluent iterable,
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Tue Jan 30 00:14:39 GMT 2024
    - 35.3K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/reflect/ClassPathTest.java

      public void testScanDirectory_symlinkCycle() throws IOException {
        if (isWindows()) {
          return; // TODO: b/136041958 - Can we detect cycles under Windows?
        }
        ClassLoader loader = ClassPathTest.class.getClassLoader();
        // directory with a cycle,
        // /root
        //    /left
        //       /[sibling -> right]
        //    /right
        //       /[sibling -> left]
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Mon Jul 10 17:06:37 GMT 2023
    - 27.7K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/graph/Graphs.java

      // Graph query methods
    
      /**
       * Returns true if {@code graph} has at least one cycle. A cycle is defined as a non-empty subset
       * of edges in a graph arranged to form a path (a sequence of adjacent outgoing edges) starting
       * and ending with the same node.
       *
       * <p>This method will detect any non-empty cycle, including self-loops (a cycle of length 1).
       */
      public static <N> boolean hasCycle(Graph<N> graph) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 21.2K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/collect/FluentIterableTest.java

        // always point to "a".
        assertEquals("a", cycle.iterator().next());
      }
    
      public void testCycle_emptyIterable() {
        FluentIterable<Integer> cycle = FluentIterable.<Integer>of().cycle();
        assertFalse(cycle.iterator().hasNext());
      }
    
      public void testCycle_removingAllElementsStopsCycle() {
        FluentIterable<Integer> cycle = fluent(1, 2).cycle();
        Iterator<Integer> iterator = cycle.iterator();
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Feb 06 18:35:19 GMT 2024
    - 31.1K bytes
    - Viewed (0)
  9. guava-testlib/src/com/google/common/testing/GcFinalization.java

              @Override
              public boolean isDone() {
                return ref.get() == null;
              }
            });
      }
    
      /**
       * Tries to perform a "full" garbage collection cycle (including processing of weak references and
       * invocation of finalize methods) and waits for it to complete. Ensures that at least one weak
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java

      }
    
      public void testSetIndirectSelf_toString() {
        final SettableFuture<Object> orig = SettableFuture.create();
        // unlike the above this indirection defeats the trivial cycle detection and causes a SOE
        orig.setFuture(
            new ForwardingListenableFuture<Object>() {
              @Override
              protected ListenableFuture<Object> delegate() {
                return orig;
              }
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 46.8K bytes
    - Viewed (0)
Back to top