Tabnine Logo
LongLongConsumer
Code IndexAdd Tabnine to your IDE (free)

How to use
LongLongConsumer
in
org.agrona.collections

Best Java code snippets using org.agrona.collections.LongLongConsumer (Showing top 3 results out of 315)

origin: org.agrona/agrona

/**
 * Iterate over all value in the map which are not at {@link #initialValue()}.
 *
 * @param consumer called for each key/value pair in the map.
 */
public void forEach(final LongLongConsumer consumer)
{
  final long[] entries = this.entries;
  final long initialValue = this.initialValue;
  @DoNotSub final int length = entries.length;
  for (@DoNotSub int i = 0; i < length; i += 2)
  {
    if (entries[i + 1] != initialValue) // lgtm [java/index-out-of-bounds]
    {
      consumer.accept(entries[i], entries[i + 1]); // lgtm [java/index-out-of-bounds]
    }
  }
}
origin: org.agrona/agrona

/**
 * Primitive specialised forEach implementation.
 * <p>
 * NB: Renamed from forEach to avoid overloading on parameter types of lambda
 * expression, which doesn't longerplay well with type inference in lambda expressions.
 *
 * @param consumer a callback called for each key/value pair in the map.
 */
public void longForEach(final LongLongConsumer consumer)
{
  final long[] entries = this.entries;
  final long missingValue = this.missingValue;
  @DoNotSub final int length = entries.length;
  for (@DoNotSub int keyIndex = 0; keyIndex < length; keyIndex += 2)
  {
    if (entries[keyIndex + 1] != missingValue) // lgtm [java/index-out-of-bounds]
    {
      consumer.accept(entries[keyIndex], entries[keyIndex + 1]); // lgtm [java/index-out-of-bounds]
    }
  }
}
origin: org.agrona/Agrona

/**
 * Primitive specialised forEach implementation.
 * <p>
 * NB: Renamed from forEach to avoid overloading on parameter types of lambda
 * expression, which doesn't longerplay well with type inference in lambda expressions.
 *
 * @param consumer a callback called for each key/value pair in the map.
 */
public void longForEach(final LongLongConsumer consumer)
{
  final long[] entries = this.entries;
  final long missingValue = this.missingValue;
  @DoNotSub final int length = entries.length;
  for (@DoNotSub int i = 0; i < length; i += 2)
  {
    final long key = entries[i];
    if (key != missingValue)
    {
      consumer.accept(entries[i], entries[i + 1]);
    }
  }
}
org.agrona.collectionsLongLongConsumer

Javadoc

This is an (long, long) primitive specialisation of a BiConsumer

Most used methods

  • accept
    Accept two values that comes as a tuple of longs.

Popular in Java

  • Creating JSON documents from java classes using gson
  • setContentView (Activity)
  • onCreateOptionsMenu (Activity)
  • getSharedPreferences (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Best plugins for Eclipse
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