Examples of enqueue()


Examples of it.unimi.dsi.fastutil.longs.LongPriorityQueue.enqueue()

   
    // The posting list iterator array (one per term) and initialization
    for (int i = 0; i < plm.size(); i++) {
      long docid = plm.getPosting(i).getId();
      assert(docid != IterablePosting.EOL);
      postingHeap.enqueue((docid << 32) + i);
    }
        boolean targetResultSetSizeReached = false;
        Queue<CandidateResult> candidateResultList = new PriorityQueue<CandidateResult>();
        int currentDocId = selectMinimumDocId(postingHeap);
        IterablePosting currentPosting = null;
View Full Code Here

Examples of java.lang.ref.Reference.enqueue()

  public void test_enqueue() {
    ReferenceQueue rq = new ReferenceQueue();
    obj = new Object();
    Reference ref = new SoftReference(obj, rq);
    assertTrue("Enqueue failed.", (!ref.isEnqueued())
        && ((ref.enqueue()) && (ref.isEnqueued())));
    assertTrue("Not properly enqueued.", rq.poll().get() == obj);
    // This fails...
    assertTrue("Should remain enqueued.", !ref.isEnqueued());
    assertTrue("Can not enqueue twice.", (!ref.enqueue())
        && (rq.poll() == null));
View Full Code Here

Examples of java.lang.ref.Reference.enqueue()

    assertTrue("Enqueue failed.", (!ref.isEnqueued())
        && ((ref.enqueue()) && (ref.isEnqueued())));
    assertTrue("Not properly enqueued.", rq.poll().get() == obj);
    // This fails...
    assertTrue("Should remain enqueued.", !ref.isEnqueued());
    assertTrue("Can not enqueue twice.", (!ref.enqueue())
        && (rq.poll() == null));

    rq = new ReferenceQueue();
    obj = new Object();
    ref = new WeakReference(obj, rq);
View Full Code Here

Examples of java.lang.ref.Reference.enqueue()

    rq = new ReferenceQueue();
    obj = new Object();
    ref = new WeakReference(obj, rq);
    assertTrue("Enqueue failed2.", (!ref.isEnqueued())
        && ((ref.enqueue()) && (ref.isEnqueued())));
    assertTrue("Not properly enqueued2.", rq.poll().get() == obj);
    assertTrue("Should remain enqueued2.", !ref.isEnqueued()); // This
    // fails.
    assertTrue("Can not enqueue twice2.", (!ref.enqueue())
        && (rq.poll() == null));
View Full Code Here

Examples of java.lang.ref.Reference.enqueue()

    assertTrue("Enqueue failed2.", (!ref.isEnqueued())
        && ((ref.enqueue()) && (ref.isEnqueued())));
    assertTrue("Not properly enqueued2.", rq.poll().get() == obj);
    assertTrue("Should remain enqueued2.", !ref.isEnqueued()); // This
    // fails.
    assertTrue("Can not enqueue twice2.", (!ref.enqueue())
        && (rq.poll() == null));
  }

  /**
   * @tests java.lang.ref.Reference#enqueue()
View Full Code Here

Examples of java.lang.ref.Reference.enqueue()

  public void test_isEnqueued() {
    ReferenceQueue rq = new ReferenceQueue();
    obj = new Object();
    Reference ref = new SoftReference(obj, rq);
    assertTrue("Should start off not enqueued.", !ref.isEnqueued());
    ref.enqueue();
    assertTrue("Should now be enqueued.", ref.isEnqueued());
    ref.enqueue();
    assertTrue("Should still be enqueued.", ref.isEnqueued());
    rq.poll();
    // This fails ...
View Full Code Here

Examples of java.lang.ref.Reference.enqueue()

    obj = new Object();
    Reference ref = new SoftReference(obj, rq);
    assertTrue("Should start off not enqueued.", !ref.isEnqueued());
    ref.enqueue();
    assertTrue("Should now be enqueued.", ref.isEnqueued());
    ref.enqueue();
    assertTrue("Should still be enqueued.", ref.isEnqueued());
    rq.poll();
    // This fails ...
    assertTrue("Should now be not enqueued.", !ref.isEnqueued());
  }
View Full Code Here

Examples of java.lang.ref.SoftReference.enqueue()

  public void test_poll() {
    // store in a static so it won't be gc'ed because the jit
    // optimized it out
    b = new Boolean(true);
    SoftReference sr = new SoftReference(b, rq);
    sr.enqueue();
    try {
      assertTrue("Remove failed.", ((Boolean) rq.poll().get())
          .booleanValue());
    } catch (Exception e) {
      fail("Exception during the test : " + e.getMessage());
View Full Code Here

Examples of java.lang.ref.SoftReference.enqueue()

  public void test_remove() {
    // store in a static so it won't be gc'ed because the jit
    // optimized it out
    b = new Boolean(true);
    SoftReference sr = new SoftReference(b, rq);
    sr.enqueue();
    try {
      assertTrue("Remove failed.", ((Boolean) rq.remove().get())
          .booleanValue());
    } catch (Exception e) {
      fail("Exception during the test : " + e.getMessage());
View Full Code Here

Examples of java.lang.ref.SoftReference.enqueue()

      synchronized (rq) {
        // store in a static so it won't be gc'ed because the jit
        // optimized it out
        integer = new Integer(667);
        SoftReference sr = new SoftReference(integer, rq);
        sr.enqueue();
        rq.notify();
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.