Tabnine Logo
Int2IntRBTreeMap.locateKey
Code IndexAdd Tabnine to your IDE (free)

How to use
locateKey
method
in
it.unimi.dsi.fastutil.ints.Int2IntRBTreeMap

Best Java code snippets using it.unimi.dsi.fastutil.ints.Int2IntRBTreeMap.locateKey (Showing top 4 results out of 315)

origin: it.unimi.dsi/fastutil

TreeIterator(final int k) {
  if ((next = locateKey(k)) != null) {
    if (compare(next.key, k) <= 0) {
      prev = next;
      next = next.next();
    } else
      prev = next.prev();
  }
}
public boolean hasNext() {
origin: it.unimi.dsi/fastutil

/**
 * Locates the first entry.
 *
 * @return the first entry of this submap, or {@code null} if the submap is
 *         empty.
 */
public Int2IntRBTreeMap.Entry firstEntry() {
  if (tree == null)
    return null;
  // If this submap goes to -infinity, we return the main map first entry;
  // otherwise, we locate the start of the map.
  Int2IntRBTreeMap.Entry e;
  if (bottom)
    e = firstEntry;
  else {
    e = locateKey(from);
    // If we find either the start or something greater we're OK.
    if (compare(e.key, from) < 0)
      e = e.next();
  }
  // Finally, if this submap doesn't go to infinity, we check that the resulting
  // key isn't greater than the end.
  if (e == null || !top && compare(e.key, to) >= 0)
    return null;
  return e;
}
/**
origin: it.unimi.dsi/fastutil

/**
 * Locates the last entry.
 *
 * @return the last entry of this submap, or {@code null} if the submap is
 *         empty.
 */
public Int2IntRBTreeMap.Entry lastEntry() {
  if (tree == null)
    return null;
  // If this submap goes to infinity, we return the main map last entry;
  // otherwise, we locate the end of the map.
  Int2IntRBTreeMap.Entry e;
  if (top)
    e = lastEntry;
  else {
    e = locateKey(to);
    // If we find something smaller than the end we're OK.
    if (compare(e.key, to) >= 0)
      e = e.prev();
  }
  // Finally, if this submap doesn't go to -infinity, we check that the resulting
  // key isn't smaller than the start.
  if (e == null || !bottom && compare(e.key, from) < 0)
    return null;
  return e;
}
@Override
origin: it.unimi.dsi/fastutil

SubmapIterator(final int k) {
  this();
  if (next != null) {
    if (!bottom && compare(k, next.key) < 0)
      prev = null;
    else if (!top && compare(k, (prev = lastEntry()).key) >= 0)
      next = null;
    else {
      next = locateKey(k);
      if (compare(next.key, k) <= 0) {
        prev = next;
        next = next.next();
      } else
        prev = next.prev();
    }
  }
}
@Override
it.unimi.dsi.fastutil.intsInt2IntRBTreeMaplocateKey

Javadoc

Locates a key.

Popular methods of Int2IntRBTreeMap

  • <init>
    Creates a new tree map using the elements of two parallel arrays and the given comparator.
  • containsValue
  • put
  • firstIntKey
  • get
  • size
  • add
    Returns a node with key k in the balanced tree, creating one with defRetValue if necessary.
  • allocatePaths
  • clear
  • compare
    Compares two keys in the right way. This method uses the #actualComparator if it is non- null. Other
  • containsKey
  • findKey
    Returns the entry corresponding to the given key, if it is in the tree; null, otherwise.
  • containsKey,
  • findKey,
  • headMap,
  • int2IntEntrySet,
  • putAll,
  • readTree,
  • remove,
  • setActualComparator,
  • subMap

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getExternalFilesDir (Context)
  • onCreateOptionsMenu (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • CodeWhisperer alternatives
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