Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 60 for Seek (0.15 sec)

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

            "Should be able to peek() middle element multiple times", "B", peekingIterator.peek());
        assertEquals(
            "next() should still return middle element after peeking", "B", peekingIterator.next());
    
        assertEquals("Should be able to peek() at last element", "C", peekingIterator.peek());
        assertEquals(
            "Should be able to peek() last element multiple times", "C", peekingIterator.peek());
        assertEquals(
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 9K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/collect/EvictingQueueTest.java

        assertTrue(queue.add("hi"));
        assertEquals("hi", queue.element());
        assertEquals("hi", queue.peek());
        assertEquals(1, queue.size());
        assertEquals(0, queue.remainingCapacity());
    
        assertTrue(queue.add("there"));
        assertEquals("there", queue.element());
        assertEquals("there", queue.peek());
        assertEquals(1, queue.size());
        assertEquals(0, queue.remainingCapacity());
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Feb 19 20:34:55 GMT 2024
    - 6.7K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/collect/AbstractIterator.java

       * contract of {@link PeekingIterator#peek()}.
       *
       * <p>Implementations of {@code AbstractIterator} that wish to expose this functionality should
       * implement {@code PeekingIterator}.
       */
      @ParametricNullness
      public final T peek() {
        if (!hasNext()) {
          throw new NoSuchElementException();
        }
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Mar 18 02:04:10 GMT 2022
    - 6.4K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/collect/SynchronizedDequeTest.java

        public boolean remove(Object object) {
          assertTrue(Thread.holdsLock(mutex));
          return delegate.remove(object);
        }
    
        @Override
        public @Nullable E peek() {
          assertTrue(Thread.holdsLock(mutex));
          return delegate.peek();
        }
    
        @Override
        public E element() {
          assertTrue(Thread.holdsLock(mutex));
          return delegate.element();
        }
    
        @Override
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 7.4K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/collect/MinMaxPriorityQueueTest.java

        assertEquals(3, (int) mmHeap.pollLast());
        assertEquals(1, (int) mmHeap.peek());
        assertEquals(2, (int) mmHeap.peekLast());
        assertEquals(2, (int) mmHeap.pollLast());
        assertEquals(1, (int) mmHeap.peek());
        assertEquals(1, (int) mmHeap.peekLast());
        assertEquals(1, (int) mmHeap.pollLast());
        assertNull(mmHeap.peek());
        assertNull(mmHeap.peekLast());
        assertNull(mmHeap.pollLast());
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 36.1K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/io/LineReader.java

       * @throws IOException if an I/O error occurs
       */
      @CanIgnoreReturnValue // to skip a line
      @CheckForNull
      public String readLine() throws IOException {
        while (lines.peek() == null) {
          Java8Compatibility.clear(cbuf);
          // The default implementation of Reader#read(CharBuffer) allocates a
          // temporary char[], so we call Reader#read(char[], int, int) instead.
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 17 14:35:11 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/collect/Iterators.java

       *     Iterators.peekingIterator(Iterators.forArray("a", "b"));
       * 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
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Apr 30 18:43:01 GMT 2024
    - 51.1K bytes
    - Viewed (0)
  8. android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedPriorityBlockingQueue.java

        } finally {
          monitor.leave();
        }
      }
    
      @CanIgnoreReturnValue // pushed down from class to method
      @Override
      public @Nullable E peek() {
        final Monitor monitor = this.monitor;
        monitor.enter();
        try {
          return q.peek();
        } finally {
          monitor.leave();
        }
      }
    
      /**
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 19.5K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/cache/LocalLoadingCacheTest.java

        Object one = new Object();
        assertSame(one, cache.getUnchecked(one));
        assertTrue(segment.recencyQueue.isEmpty());
        assertSame(one, map.get(one));
        assertSame(one, segment.recencyQueue.peek().getKey());
        assertSame(one, cache.getUnchecked(one));
        assertFalse(segment.recencyQueue.isEmpty());
      }
    
      public void testRecursiveComputation() throws InterruptedException {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 12.3K bytes
    - Viewed (0)
  10. android/guava-testlib/src/com/google/common/collect/testing/testers/QueuePeekTester.java

      @CollectionSize.Require(ZERO)
      public void testPeek_empty() {
        assertNull("emptyQueue.peek() should return null", getQueue().peek());
        expectUnchanged();
      }
    
      @CollectionSize.Require(ONE)
      public void testPeek_size1() {
        assertEquals("size1Queue.peek() should return first element", e0(), getQueue().peek());
        expectUnchanged();
      }
    
      @CollectionFeature.Require(KNOWN_ORDER)
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Jan 09 20:10:38 GMT 2018
    - 2.1K bytes
    - Viewed (0)
Back to top