Codota Logo
LinkedTransferQueue.xfer
Code IndexAdd Codota to your IDE (free)

How to use
xfer
method
in
jsr166y.LinkedTransferQueue

Best Java code snippets using jsr166y.LinkedTransferQueue.xfer (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: h2oai/h2o-2

/**
 * Inserts the specified element at the tail of this queue.
 * As the queue is unbounded, this method will never throw
 * {@link IllegalStateException} or return {@code false}.
 *
 * @return {@code true} (as specified by {@link Collection#add})
 * @throws NullPointerException if the specified element is null
 */
public boolean add(E e) {
  xfer(e, true, ASYNC, 0);
  return true;
}
origin: h2oai/h2o-2

/**
 * Inserts the specified element at the tail of this queue.
 * As the queue is unbounded, this method will never block.
 *
 * @throws NullPointerException if the specified element is null
 */
public void put(E e) {
  xfer(e, true, ASYNC, 0);
}
origin: h2oai/h2o-2

/**
 * Inserts the specified element at the tail of this queue.
 * As the queue is unbounded, this method will never return {@code false}.
 *
 * @return {@code true} (as specified by {@link Queue#offer})
 * @throws NullPointerException if the specified element is null
 */
public boolean offer(E e) {
  xfer(e, true, ASYNC, 0);
  return true;
}
origin: h2oai/h2o-2

/**
 * Transfers the element to a waiting consumer immediately, if possible.
 *
 * <p>More precisely, transfers the specified element immediately
 * if there exists a consumer already waiting to receive it (in
 * {@link #take} or timed {@link #poll(long,TimeUnit) poll}),
 * otherwise returning {@code false} without enqueuing the element.
 *
 * @throws NullPointerException if the specified element is null
 */
public boolean tryTransfer(E e) {
  return xfer(e, true, NOW, 0) == null;
}
origin: h2oai/h2o-2

public E poll() {
  return xfer(null, false, NOW, 0);
}
origin: h2oai/h2o-2

/**
 * Inserts the specified element at the tail of this queue.
 * As the queue is unbounded, this method will never block or
 * return {@code false}.
 *
 * @return {@code true} (as specified by
 *  {@link java.util.concurrent.BlockingQueue#offer(Object,long,TimeUnit)
 *  BlockingQueue.offer})
 * @throws NullPointerException if the specified element is null
 */
public boolean offer(E e, long timeout, TimeUnit unit) {
  xfer(e, true, ASYNC, 0);
  return true;
}
origin: h2oai/h2o-2

public E take() throws InterruptedException {
  E e = xfer(null, false, SYNC, 0);
  if (e != null)
    return e;
  Thread.interrupted();
  throw new InterruptedException();
}
origin: h2oai/h2o-2

public E poll(long timeout, TimeUnit unit) throws InterruptedException {
  E e = xfer(null, false, TIMED, unit.toNanos(timeout));
  if (e != null || !Thread.interrupted())
    return e;
  throw new InterruptedException();
}
origin: h2oai/h2o-2

/**
 * Transfers the element to a consumer, waiting if necessary to do so.
 *
 * <p>More precisely, transfers the specified element immediately
 * if there exists a consumer already waiting to receive it (in
 * {@link #take} or timed {@link #poll(long,TimeUnit) poll}),
 * else inserts the specified element at the tail of this queue
 * and waits until the element is received by a consumer.
 *
 * @throws NullPointerException if the specified element is null
 */
public void transfer(E e) throws InterruptedException {
  if (xfer(e, true, SYNC, 0) != null) {
    Thread.interrupted(); // failure possible only due to interrupt
    throw new InterruptedException();
  }
}
origin: h2oai/h2o-2

/**
 * Transfers the element to a consumer if it is possible to do so
 * before the timeout elapses.
 *
 * <p>More precisely, transfers the specified element immediately
 * if there exists a consumer already waiting to receive it (in
 * {@link #take} or timed {@link #poll(long,TimeUnit) poll}),
 * else inserts the specified element at the tail of this queue
 * and waits until the element is received by a consumer,
 * returning {@code false} if the specified wait time elapses
 * before the element can be transferred.
 *
 * @throws NullPointerException if the specified element is null
 */
public boolean tryTransfer(E e, long timeout, TimeUnit unit)
  throws InterruptedException {
  if (xfer(e, true, TIMED, unit.toNanos(timeout)) == null)
    return true;
  if (!Thread.interrupted())
    return false;
  throw new InterruptedException();
}
origin: org.codehaus.jsr166-mirror/jsr166y

/**
 * Inserts the specified element at the tail of this queue.
 * As the queue is unbounded, this method will never block.
 *
 * @throws NullPointerException if the specified element is null
 */
public void put(E e) {
  xfer(e, true, ASYNC, 0);
}
origin: org.codehaus.jsr166-mirror/jsr166y

/**
 * Inserts the specified element at the tail of this queue.
 * As the queue is unbounded, this method will never return {@code false}.
 *
 * @return {@code true} (as specified by {@link Queue#offer})
 * @throws NullPointerException if the specified element is null
 */
public boolean offer(E e) {
  xfer(e, true, ASYNC, 0);
  return true;
}
origin: org.codehaus.jsr166-mirror/jsr166y

/**
 * Inserts the specified element at the tail of this queue.
 * As the queue is unbounded, this method will never throw
 * {@link IllegalStateException} or return {@code false}.
 *
 * @return {@code true} (as specified by {@link Collection#add})
 * @throws NullPointerException if the specified element is null
 */
public boolean add(E e) {
  xfer(e, true, ASYNC, 0);
  return true;
}
origin: org.codehaus.jsr166-mirror/jsr166y

/**
 * Transfers the element to a waiting consumer immediately, if possible.
 *
 * <p>More precisely, transfers the specified element immediately
 * if there exists a consumer already waiting to receive it (in
 * {@link #take} or timed {@link #poll(long,TimeUnit) poll}),
 * otherwise returning {@code false} without enqueuing the element.
 *
 * @throws NullPointerException if the specified element is null
 */
public boolean tryTransfer(E e) {
  return xfer(e, true, NOW, 0) == null;
}
origin: org.codehaus.jsr166-mirror/jsr166y

/**
 * Inserts the specified element at the tail of this queue.
 * As the queue is unbounded, this method will never block or
 * return {@code false}.
 *
 * @return {@code true} (as specified by
 *  {@link BlockingQueue#offer(Object,long,TimeUnit) BlockingQueue.offer})
 * @throws NullPointerException if the specified element is null
 */
public boolean offer(E e, long timeout, TimeUnit unit) {
  xfer(e, true, ASYNC, 0);
  return true;
}
origin: org.codehaus.jsr166-mirror/jsr166y

public E poll() {
  return xfer(null, false, NOW, 0);
}
origin: org.codehaus.jsr166-mirror/jsr166y

public E take() throws InterruptedException {
  E e = xfer(null, false, SYNC, 0);
  if (e != null)
    return e;
  Thread.interrupted();
  throw new InterruptedException();
}
origin: org.codehaus.jsr166-mirror/jsr166y

public E poll(long timeout, TimeUnit unit) throws InterruptedException {
  E e = xfer(null, false, TIMED, unit.toNanos(timeout));
  if (e != null || !Thread.interrupted())
    return e;
  throw new InterruptedException();
}
origin: org.codehaus.jsr166-mirror/jsr166y

/**
 * Transfers the element to a consumer, waiting if necessary to do so.
 *
 * <p>More precisely, transfers the specified element immediately
 * if there exists a consumer already waiting to receive it (in
 * {@link #take} or timed {@link #poll(long,TimeUnit) poll}),
 * else inserts the specified element at the tail of this queue
 * and waits until the element is received by a consumer.
 *
 * @throws NullPointerException if the specified element is null
 */
public void transfer(E e) throws InterruptedException {
  if (xfer(e, true, SYNC, 0) != null) {
    Thread.interrupted(); // failure possible only due to interrupt
    throw new InterruptedException();
  }
}
origin: org.codehaus.jsr166-mirror/jsr166y

/**
 * Transfers the element to a consumer if it is possible to do so
 * before the timeout elapses.
 *
 * <p>More precisely, transfers the specified element immediately
 * if there exists a consumer already waiting to receive it (in
 * {@link #take} or timed {@link #poll(long,TimeUnit) poll}),
 * else inserts the specified element at the tail of this queue
 * and waits until the element is received by a consumer,
 * returning {@code false} if the specified wait time elapses
 * before the element can be transferred.
 *
 * @throws NullPointerException if the specified element is null
 */
public boolean tryTransfer(E e, long timeout, TimeUnit unit)
  throws InterruptedException {
  if (xfer(e, true, TIMED, unit.toNanos(timeout)) == null)
    return true;
  if (!Thread.interrupted())
    return false;
  throw new InterruptedException();
}
jsr166yLinkedTransferQueuexfer

Javadoc

Implements all queuing methods. See above for explanation.

Popular methods of LinkedTransferQueue

  • offer
    Inserts the specified element at the tail of this queue. As the queue is unbounded, this method will
  • poll
  • <init>
    Creates a LinkedTransferQueueinitially containing the elements of the given collection, added in tra
  • addAll
  • awaitMatch
    Spins/yields/blocks until node s is matched or caller gives up.
  • casHead
  • casSweepVotes
  • casTail
  • cast
  • countOfMode
    Traverses and counts unmatched nodes of the given mode. Used by methods size and getWaitingConsumerC
  • findAndRemove
    Main implementation of remove(Object)
  • firstDataItem
    Returns the item in the first unmatched node with isData; or null if none. Used by peek.
  • findAndRemove,
  • firstDataItem,
  • firstOfMode,
  • spinsFor,
  • succ,
  • sweep,
  • tryAppend,
  • unsplice,
  • clear

Popular in Java

  • Making http post requests using okhttp
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Notification (javax.management)
  • JList (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Table (org.hibernate.mapping)
    A relational table
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now