Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 108 for limits (6.22 sec)

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

        Iterable<String> iterable = newArrayList("foo", "bar", "baz");
        Iterable<String> limited = Iterables.limit(iterable, 2);
    
        List<String> expected = ImmutableList.of("foo", "bar");
        List<String> actual = newArrayList(limited);
        assertEquals(expected, actual);
        assertCanIterateAgain(limited);
        assertEquals("[foo, bar]", limited.toString());
      }
    
      public void testLimit_illegalArgument() {
    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)
  2. android/guava/src/com/google/common/collect/MinMaxPriorityQueue.java

         */
        int findMin(int index, int len) {
          if (index >= size) {
            return -1;
          }
          checkState(index > 0);
          int limit = Math.min(index, size - len) + len;
          int minIndex = index;
          for (int i = index + 1; i < limit; i++) {
            if (compareElements(i, minIndex) < 0) {
              minIndex = i;
            }
          }
          return minIndex;
        }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 21:19:52 GMT 2024
    - 34K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java

        RateLimiter limiter = RateLimiter.create(Double.POSITIVE_INFINITY, stopwatch);
        limiter.acquire(Integer.MAX_VALUE / 4);
        limiter.acquire(Integer.MAX_VALUE / 2);
        limiter.acquire(Integer.MAX_VALUE);
        assertEvents("R0.00", "R0.00", "R0.00"); // no wait, infinite rate!
    
        limiter.setRate(2.0);
        limiter.acquire();
        limiter.acquire();
        limiter.acquire();
        limiter.acquire();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.6K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/io/ByteStreamsTest.java

        InputStream bin = new ByteArrayInputStream(big);
        InputStream lin = ByteStreams.limit(bin, 2);
    
        IOException expected = assertThrows(IOException.class, () -> lin.reset());
        assertThat(expected).hasMessageThat().isEqualTo("Mark not set");
      }
    
      public void testLimit_markNotSupported() {
        InputStream lin = ByteStreams.limit(new UnmarkableInputStream(), 2);
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.9K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/graph/Traverser.java

       *
       * <p>The returned {@code Iterable} can be iterated over multiple times. Every iterator will
       * compute its next element on the fly. It is thus possible to limit the traversal to a certain
       * number of nodes as follows:
       *
       * <pre>{@code
       * Iterables.limit(Traverser.forGraph(graph).breadthFirst(node), maxNumberOfNodes);
       * }</pre>
       *
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue May 30 20:12:45 GMT 2023
    - 19.8K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/collect/StreamsTest.java

      public void testConcatInfiniteStream() {
        assertThat(Streams.concat(Stream.of(1, 2, 3), Stream.generate(() -> 5)).limit(5))
            .containsExactly(1, 2, 3, 5, 5)
            .inOrder();
      }
    
      public void testConcatInfiniteStream_int() {
        assertThat(Streams.concat(IntStream.of(1, 2, 3), IntStream.generate(() -> 5)).limit(5))
            .containsExactly(1, 2, 3, 5, 5)
            .inOrder();
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 20K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/math/IntMath.java

            return ((k & 1) == 0) ? 1 << k : -1 << k;
          default:
            // continue below to handle the general case
        }
        int accum = 1;
        // if b is negative and k is odd then the limit is MIN otherwise the limit is MAX
        int limit = Integer.MAX_VALUE + ((b >>> Integer.SIZE - 1) & (k & 1));
        while (true) {
          switch (k) {
            case 0:
              return accum;
            case 1:
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 23.5K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/io/FilesFileTraverserTest.java

          throws Exception {
        File fileA = newFile("file-a");
        File dir1 = newDir("dir-1");
        newFile("dir-1/file-b");
        newFile("dir-1/dir-2");
    
        assertThat(Iterables.limit(Files.fileTraverser().breadthFirst(rootDir), 3))
            .containsExactly(rootDir, fileA, dir1);
      }
    
      public void testFileTraverser_multipleDirectoryLayers_traversalReturnsAll() throws Exception {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Apr 21 20:17:27 GMT 2023
    - 3.4K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/io/MoreFilesFileTraverserTest.java

          throws Exception {
        Path fileA = newFile("file-a");
        Path dir1 = newDir("dir-1");
        newFile("dir-1/file-b");
        newFile("dir-1/dir-2");
    
        assertThat(Iterables.limit(MoreFiles.fileTraverser().breadthFirst(rootDir), 3))
            .containsExactly(rootDir, fileA, dir1);
      }
    
      public void testFileTraverser_multipleDirectoryLayers_traversalReturnsAll() throws Exception {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Apr 09 19:30:52 GMT 2018
    - 3.8K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/net/InetAddresses.java

       * <p>Anything after a {@code %} in an IPv6 address is ignored (assumed to be a Scope ID).
       *
       * <p>This method accepts non-ASCII digits, for example {@code "192.168.0.1"} (those are fullwidth
       * characters). That is consistent with {@link InetAddress}, but not with various RFCs. If you
       * want to accept ASCII digits only, you can use something like {@code
       * CharMatcher.ascii().matchesAllOf(ipString)}.
       *
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Dec 15 19:31:54 GMT 2023
    - 44K bytes
    - Viewed (1)
Back to top