Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 26 for Recycle (0.18 sec)

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

          assertTrue(cycle.hasNext());
          assertEquals("b", cycle.next());
        }
      }
    
      public void testCycleOfTwoWithRemove() {
        Iterable<String> iterable = Lists.newArrayList("a", "b");
        Iterator<String> cycle = Iterators.cycle(iterable);
        assertTrue(cycle.hasNext());
        assertEquals("a", cycle.next());
        assertTrue(cycle.hasNext());
        assertEquals("b", cycle.next());
        assertTrue(cycle.hasNext());
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 55.7K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java

     *       verified or created.
     *   <li>If a new edge needs to be created, the outgoing edges of the acquired locks are traversed
     *       to check for a cycle that reaches the lock to be acquired. If no cycle is detected, a new
     *       "safe" edge is created.
     *   <li>If a cycle is detected, an "unsafe" (cyclic) edge is created to represent a potential
     *       deadlock situation, and the appropriate Policy is executed.
     * </ul>
     *
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Dec 15 19:31:54 GMT 2023
    - 35.9K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/collect/Iterables.java

       * elements.
       *
       * <p>To cycle over the iterable {@code n} times, use the following: {@code
       * Iterables.concat(Collections.nCopies(n, iterable))}
       *
       * <p><b>Java 8+ users:</b> The {@code Stream} equivalent of this method is {@code
       * Stream.generate(() -> iterable).flatMap(Streams::stream)}.
       */
      public static <T extends @Nullable Object> Iterable<T> cycle(final Iterable<T> iterable) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Apr 24 19:38:27 GMT 2024
    - 42.8K bytes
    - Viewed (0)
  4. 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 Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 21.3K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/collect/AbstractImmutableSetTest.java

                ImmutableSet.of("d", "c", "b", "a"));
        for (boolean byAscendingSize : new boolean[] {true, false}) {
          Iterable<ImmutableSet<String>> infiniteSets =
              Iterables.cycle(
                  byAscendingSize
                      ? distinctCandidatesByAscendingSize
                      : Lists.reverse(distinctCandidatesByAscendingSize));
          for (int startIndex = 0;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 18.7K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/collect/AbstractImmutableSetTest.java

                ImmutableSet.of("d", "c", "b", "a"));
        for (boolean byAscendingSize : new boolean[] {true, false}) {
          Iterable<ImmutableSet<String>> infiniteSets =
              Iterables.cycle(
                  byAscendingSize
                      ? distinctCandidatesByAscendingSize
                      : Lists.reverse(distinctCandidatesByAscendingSize));
          for (int startIndex = 0;
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 18.7K bytes
    - Viewed (0)
  7. android/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 May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. 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 Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 47.5K bytes
    - Viewed (0)
Back to top