Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 122 for Queue (0.32 sec)

  1. android/guava-tests/test/com/google/common/util/concurrent/ListenerCallQueueTest.java

        ListenerCallQueue<Object> queue = new ListenerCallQueue<>();
        queue.addListener(listener, directExecutor());
    
        Multiset<Object> counters = ConcurrentHashMultiset.create();
        queue.enqueue(incrementingEvent(counters, listener, 1));
        queue.enqueue(THROWING_EVENT);
        queue.enqueue(incrementingEvent(counters, listener, 2));
        queue.enqueue(THROWING_EVENT);
        queue.enqueue(incrementingEvent(counters, listener, 3));
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 8.2K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/util/concurrent/SequentialExecutor.java

      private final Executor executor;
    
      @GuardedBy("queue")
      private final Deque<Runnable> queue = new ArrayDeque<>();
    
      /** see {@link WorkerRunningState} */
      @LazyInit
      @GuardedBy("queue")
      private WorkerRunningState workerRunningState = IDLE;
    
      /**
       * This counter prevents an ABA issue where a thread may successfully schedule the worker, the
       * worker runs and exhausts the queue, another thread enqueues a task and fails to schedule the
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 01 21:46:34 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  3. guava-testlib/src/com/google/common/collect/testing/TestsForQueuesInJavaUtil.java

        return QueueTestSuiteBuilder.using(
                new TestStringQueueGenerator() {
                  @Override
                  public Queue<String> create(String[] elements) {
                    Queue<String> queue = new LinkedList<>(MinimalCollection.of(elements));
                    return Collections.checkedQueue(queue, String.class);
                  }
                })
            .named("checkedQueue/LinkedList")
            .withFeatures(
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 9.4K bytes
    - Viewed (0)
  4. guava-tests/benchmark/com/google/common/util/concurrent/MonitorBenchmark.java

        queue = (BlockingQueue<String>) constructor.newInstance(capacity);
    
        strings = new String[capacity];
        for (int i = 0; i < capacity; i++) {
          strings[i] = String.valueOf(Math.random());
        }
      }
    
      @Benchmark
      void addsAndRemoves(int reps) {
        int capacity = this.capacity;
        BlockingQueue<String> queue = this.queue;
        String[] strings = this.strings;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/base/FinalizableWeakReference.java

      /**
       * Constructs a new finalizable weak reference.
       *
       * @param referent to weakly reference
       * @param queue that should finalize the referent
       */
      protected FinalizableWeakReference(@CheckForNull T referent, FinalizableReferenceQueue queue) {
        super(referent, queue.queue);
        queue.cleanUp();
      }
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 23 15:09:35 GMT 2023
    - 1.6K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/collect/SynchronizedQueueTest.java

    import java.util.Collection;
    import java.util.Iterator;
    import java.util.Queue;
    import junit.framework.TestCase;
    import org.checkerframework.checker.nullness.qual.Nullable;
    
    /**
     * Tests for {@link Synchronized#queue} and {@link Queues#synchronizedQueue}.
     *
     * @author Kurt Alfred Kluever
     */
    public class SynchronizedQueueTest extends TestCase {
    
      protected Queue<String> create() {
        TestQueue<String> inner = new TestQueue<>();
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 4.7K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/collect/ForwardingQueue.java

    import java.util.NoSuchElementException;
    import java.util.Queue;
    import javax.annotation.CheckForNull;
    import org.checkerframework.checker.nullness.qual.Nullable;
    
    /**
     * A queue which forwards all its method calls to another queue. Subclasses should override one or
     * more methods to modify the behavior of the backing queue as desired per the <a
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Jun 29 19:42:21 GMT 2021
    - 4.1K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/collect/EvictingQueue.java

    import java.util.Collection;
    import java.util.Queue;
    
    /**
     * A non-blocking queue which automatically evicts elements from the head of the queue when
     * attempting to add new elements onto the queue and it is full. This queue orders elements FIFO
     * (first-in-first-out). This data structure is logically equivalent to a circular buffer (i.e.,
     * cyclic buffer or ring buffer).
     *
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri May 12 17:52:55 GMT 2023
    - 4.6K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/collect/MinMaxPriorityQueueTest.java

        assertEquals(6, queue.size());
        assertEquals(8, queue.capacity());
        checkUnbounded(queue);
        checkNatural(queue);
      }
    
      public void testCreation_maximumSize_withContents() {
        MinMaxPriorityQueue<Integer> queue =
            rawtypeToWildcard(MinMaxPriorityQueue.maximumSize(42)).create(NUMBERS);
        assertEquals(6, queue.size());
        assertEquals(11, queue.capacity());
        assertEquals(42, queue.maximumSize);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 36.1K bytes
    - Viewed (0)
  10. android/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();
      }
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Sat Jan 21 14:48:03 GMT 2023
    - 1.5K bytes
    - Viewed (0)
Back to top