Codota Logo
jsr166y
Code IndexAdd Codota to your IDE (free)

How to use jsr166y

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
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

/**
 * @throws NullPointerException if the task is null
 * @throws RejectedExecutionException if the task cannot be
 *         scheduled for execution
 */
public <T> ForkJoinTask<T> submit(Callable<T> task) {
  ForkJoinTask<T> job = new ForkJoinTask.AdaptedCallable<T>(task);
  doSubmit(job);
  return job;
}
origin: h2oai/h2o-2

public E pollFirst() {
  for (Node<E> p = first(); p != null; p = succ(p)) {
    E item = p.item;
    if (item != null && p.casItem(item, null)) {
      unlink(p);
      return item;
    }
  }
  return null;
}
origin: h2oai/h2o-2

/**
 * Polls and runs tasks until empty.
 */
private void pollAndExecAll() {
  for (ForkJoinTask<?> t; (t = poll()) != null;)
    t.doExec();
}
origin: h2oai/h2o-2

/**
 * Top-level runloop for workers, called by ForkJoinWorkerThread.run.
 */
final void runWorker(WorkQueue w) {
  w.growArray(false);         // initialize queue array in this thread
  do { w.runTask(scan(w)); } while (w.runState >= 0);
}
origin: h2oai/h2o-2

public E pollLast() {
  for (Node<E> p = last(); p != null; p = pred(p)) {
    E item = p.item;
    if (item != null && p.casItem(item, null)) {
      unlink(p);
      return item;
    }
  }
  return null;
}
origin: h2oai/h2o-2

/**
 * Removes and cancels all known tasks, ignoring any exceptions.
 */
final void cancelAll() {
  ForkJoinTask.cancelIgnoringExceptions(currentJoin);
  ForkJoinTask.cancelIgnoringExceptions(currentSteal);
  for (ForkJoinTask<?> t; (t = poll()) != null; )
    ForkJoinTask.cancelIgnoringExceptions(t);
}
origin: h2oai/h2o-2

/**
 * Returns the number of registered parties that have arrived at
 * the current phase of this phaser. If this phaser has terminated,
 * the returned value is meaningless and arbitrary.
 *
 * @return the number of arrived parties
 */
public int getArrivedParties() {
  return arrivedOf(reconcileState());
}
origin: h2oai/h2o-2

/**
 * @throws NullPointerException if the task is null
 * @throws RejectedExecutionException if the task cannot be
 *         scheduled for execution
 */
public <T> ForkJoinTask<T> submit(Runnable task, T result) {
  ForkJoinTask<T> job = new ForkJoinTask.AdaptedRunnable<T>(task, result);
  doSubmit(job);
  return job;
}
origin: h2oai/h2o-2

/**
 * Returns a new {@code ForkJoinTask} that performs the {@code call}
 * method of the given {@code Callable} as its action, and returns
 * its result upon {@link #join}, translating any checked exceptions
 * encountered into {@code RuntimeException}.
 *
 * @param callable the callable action
 * @return the task
 */
public static <T> ForkJoinTask<T> adapt(Callable<? extends T> callable) {
  return new AdaptedCallable<T>(callable);
}
origin: h2oai/h2o-2

/**
 * @throws NoSuchElementException {@inheritDoc}
 */
public E getLast() {
  return screenNullResult(peekLast());
}
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

/**
 * @throws NoSuchElementException {@inheritDoc}
 */
public E removeFirst() {
  return screenNullResult(pollFirst());
}
origin: h2oai/h2o-2

/**
 * Returns message string for bounds exceptions on registration.
 */
private String badRegister(long s) {
  return "Attempt to register more than " +
    MAX_PARTIES + " parties for " + stateToString(s);
}
origin: h2oai/h2o-2

/**
 * Joins this task, without returning its result or throwing its
 * exception. This method may be useful when processing
 * collections of tasks when some have been cancelled or otherwise
 * known to have aborted.
 */
public final void quietlyJoin() {
  doJoin();
}
origin: h2oai/h2o-2

/**
 * Returns a new {@code ForkJoinTask} that performs the {@code run}
 * method of the given {@code Runnable} as its action, and returns
 * the given result upon {@link #join}.
 *
 * @param runnable the runnable action
 * @param result the result upon completion
 * @return the task
 */
public static <T> ForkJoinTask<T> adapt(Runnable runnable, T result) {
  return new AdaptedRunnable<T>(runnable, result);
}
origin: h2oai/h2o-2

/**
 * Inserts the specified element at the tail of this deque.
 * As the deque 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) {
  return offerLast(e);
}
origin: h2oai/h2o-2

/**
 * Returns a new {@code ForkJoinTask} that performs the {@code run}
 * method of the given {@code Runnable} as its action, and returns
 * a null result upon {@link #join}.
 *
 * @param runnable the runnable action
 * @return the task
 */
public static ForkJoinTask<?> adapt(Runnable runnable) {
  return new AdaptedRunnableAction(runnable);
}
origin: h2oai/h2o-2

/**
 * Removes all of the elements from this deque.
 */
public void clear() {
  while (pollFirst() != null)
    ;
}
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;
}
jsr166y

Most used classes

  • ForkJoinPool
    An ExecutorService for running ForkJoinTasks. A ForkJoinPool provides the entry point for submission
  • ForkJoinTask
    Abstract base class for tasks that run within a ForkJoinPool. A ForkJoinTask is a thread-like entity
  • LinkedTransferQueue
    An unbounded TransferQueue based on linked nodes. This queue orders elements FIFO (first-in-first-ou
  • RecursiveAction
    A recursive resultless ForkJoinTask. This class establishes conventions to parameterize resultless a
  • ThreadLocalRandom
    A random number generator isolated to the current thread. Like the global java.util.Random generator
  • ForkJoinPool$ForkJoinWorkerThreadFactory,
  • ForkJoinPool$ManagedBlocker,
  • ForkJoinTask$AdaptedCallable,
  • ForkJoinTask$AdaptedRunnable,
  • ForkJoinTask$ExceptionNode,
  • ForkJoinWorkerThread,
  • LinkedTransferQueue$Itr,
  • LinkedTransferQueue$Node,
  • Phaser$QNode,
  • RecursiveTask,
  • ConcurrentLinkedDeque$DescendingItr,
  • ConcurrentLinkedDeque$Itr,
  • ConcurrentLinkedDeque$Node,
  • ConcurrentLinkedDeque
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