Tabnine Logo
LinkedTransferQueue.succ
Code IndexAdd Tabnine to your IDE (free)

How to use
succ
method
in
jsr166y.LinkedTransferQueue

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

origin: h2oai/h2o-2

/**
 * Returns {@code true} if this queue contains the specified element.
 * More formally, returns {@code true} if and only if this queue contains
 * at least one element {@code e} such that {@code o.equals(e)}.
 *
 * @param o object to be checked for containment in this queue
 * @return {@code true} if this queue contains the specified element
 */
public boolean contains(Object o) {
  if (o == null) return false;
  for (Node p = head; p != null; p = succ(p)) {
    Object item = p.item;
    if (p.isData) {
      if (item != null && item != p && o.equals(item))
        return true;
    }
    else if (item == null)
      break;
  }
  return false;
}
origin: h2oai/h2o-2

/**
 * Returns {@code true} if this queue contains no elements.
 *
 * @return {@code true} if this queue contains no elements
 */
public boolean isEmpty() {
  for (Node p = head; p != null; p = succ(p)) {
    if (!p.isMatched())
      return !p.isData;
  }
  return true;
}
origin: h2oai/h2o-2

/**
 * Returns the first unmatched node of the given mode, or null if
 * none.  Used by methods isEmpty, hasWaitingConsumer.
 */
private Node firstOfMode(boolean isData) {
  for (Node p = head; p != null; p = succ(p)) {
    if (!p.isMatched())
      return (p.isData == isData) ? p : null;
  }
  return null;
}
origin: h2oai/h2o-2

/**
 * Returns the item in the first unmatched node with isData; or
 * null if none.  Used by peek.
 */
private E firstDataItem() {
  for (Node p = head; p != null; p = succ(p)) {
    Object item = p.item;
    if (p.isData) {
      if (item != null && item != p)
        return LinkedTransferQueue.<E>cast(item);
    }
    else if (item == null)
      return null;
  }
  return null;
}
origin: org.codehaus.jsr166-mirror/jsr166y

/**
 * Returns {@code true} if this queue contains the specified element.
 * More formally, returns {@code true} if and only if this queue contains
 * at least one element {@code e} such that {@code o.equals(e)}.
 *
 * @param o object to be checked for containment in this queue
 * @return {@code true} if this queue contains the specified element
 */
public boolean contains(Object o) {
  if (o == null) return false;
  for (Node p = head; p != null; p = succ(p)) {
    Object item = p.item;
    if (p.isData) {
      if (item != null && item != p && o.equals(item))
        return true;
    }
    else if (item == null)
      break;
  }
  return false;
}
origin: org.codehaus.jsr166-mirror/jsr166y

/**
 * Returns {@code true} if this queue contains no elements.
 *
 * @return {@code true} if this queue contains no elements
 */
public boolean isEmpty() {
  for (Node p = head; p != null; p = succ(p)) {
    if (!p.isMatched())
      return !p.isData;
  }
  return true;
}
origin: org.codehaus.jsr166-mirror/jsr166y

/**
 * Returns the first unmatched node of the given mode, or null if
 * none.  Used by methods isEmpty, hasWaitingConsumer.
 */
private Node firstOfMode(boolean isData) {
  for (Node p = head; p != null; p = succ(p)) {
    if (!p.isMatched())
      return (p.isData == isData) ? p : null;
  }
  return null;
}
origin: org.codehaus.jsr166-mirror/jsr166y

/**
 * Returns the item in the first unmatched node with isData; or
 * null if none.  Used by peek.
 */
private E firstDataItem() {
  for (Node p = head; p != null; p = succ(p)) {
    Object item = p.item;
    if (p.isData) {
      if (item != null && item != p)
        return this.<E>cast(item);
    }
    else if (item == null)
      return null;
  }
  return null;
}
jsr166yLinkedTransferQueuesucc

Javadoc

Returns the successor of p, or the head node if p.next has been linked to self, which will only be true if traversing with a stale pointer that is now off the list.

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,
  • sweep,
  • tryAppend,
  • unsplice,
  • xfer,
  • clear

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setContentView (Activity)
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • ImageIO (javax.imageio)
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now