Tabnine Logo
SortedKeyIndex.getUpperBound
Code IndexAdd Tabnine to your IDE (free)

How to use
getUpperBound
method
in
org.lenskit.util.keys.SortedKeyIndex

Best Java code snippets using org.lenskit.util.keys.SortedKeyIndex.getUpperBound (Showing top 13 results out of 315)

origin: lenskit/lenskit

Long2DoubleSortedArrayMap(SortedKeyIndex ks, double[] vs) {
  Preconditions.checkArgument(vs.length >= ks.getUpperBound(),
                "index and value sizes mismatched");
  keys = ks;
  values = vs;
}
origin: lenskit/lenskit

@Override
public Entry last() {
  if (isEmpty()) {
    throw new NoSuchElementException();
  }
  return entry(keys.getUpperBound() - 1);
}
origin: lenskit/lenskit

@Override
public long lastLong() {
  if (keys.size() > 0) {
    return keys.getKey(keys.getUpperBound() - 1);
  } else {
    throw new NoSuchElementException();
  }
}
origin: lenskit/lenskit

@Override
public Long2DoubleSortedMap tailMap(long l) {
  int startIdx = keys.findLowerBound(l); // include 'l'
  return createSubMap(startIdx, keys.getUpperBound());
}
origin: lenskit/lenskit

public EntryIter() {
  iter = IntIterators.fromTo(keys.getLowerBound(), keys.getUpperBound());
}
origin: lenskit/lenskit

@Override
public LongSortedSet tailSet(long key) {
  int start = keys.findLowerBound(key);
  int end = keys.getUpperBound();
  return new LongSortedArraySet(keys.subIndex(start, end));
}
origin: org.lenskit/lenskit-core

Long2DoubleSortedArrayMap(SortedKeyIndex ks, double[] vs) {
  Preconditions.checkArgument(vs.length >= ks.getUpperBound(),
                "index and value sizes mismatched");
  keys = ks;
  values = vs;
}
origin: lenskit/lenskit

  @Test
  public void testSubViewLowerBound() {
    SortedKeyIndex keys = SortedKeyIndex.create(0, 1, 2, 3, 4, 5, 6, 7);
    SortedKeyIndex subk = keys.subIndex(1, 5);
    assertThat(subk.getLowerBound(), equalTo(1));
    assertThat(subk.getUpperBound(), equalTo(5));
    assertThat(subk.tryGetIndex(1), equalTo(1));
    assertThat(subk.tryGetIndex(4), equalTo(4));
    assertThat(subk.tryGetIndex(5), lessThan(0));
    assertThat(subk.tryGetIndex(6), lessThan(0));
    assertThat(subk.tryGetIndex(0), lessThan(0));
    assertThat(subk.findLowerBound(1L), equalTo(1));
    assertThat(subk.findLowerBound(0L), equalTo(1));
    assertThat(subk.findLowerBound(2L), equalTo(2));
    assertThat(subk.findLowerBound(7L), equalTo(5));
    assertThat(subk.findUpperBound(1), equalTo(2));
    assertThat(subk.findUpperBound(5), equalTo(5));
    assertThat(subk.findUpperBound(4), equalTo(5));
  }
}
origin: org.lenskit/lenskit-core

@Override
public Entry last() {
  if (isEmpty()) {
    throw new NoSuchElementException();
  }
  return entry(keys.getUpperBound() - 1);
}
origin: org.lenskit/lenskit-core

@Override
public long lastLong() {
  if (keys.size() > 0) {
    return keys.getKey(keys.getUpperBound() - 1);
  } else {
    throw new NoSuchElementException();
  }
}
origin: org.lenskit/lenskit-core

@Override
public Long2DoubleSortedMap tailMap(long l) {
  int startIdx = keys.findLowerBound(l); // include 'l'
  return createSubMap(startIdx, keys.getUpperBound());
}
origin: org.lenskit/lenskit-core

public EntryIter() {
  iter = IntIterators.fromTo(keys.getLowerBound(), keys.getUpperBound());
}
origin: org.lenskit/lenskit-core

@Override
public LongSortedSet tailSet(long key) {
  int start = keys.findLowerBound(key);
  int end = keys.getUpperBound();
  return new LongSortedArraySet(keys.subIndex(start, end));
}
org.lenskit.util.keysSortedKeyIndexgetUpperBound

Javadoc

Get the upper bound of this index.

Popular methods of SortedKeyIndex

  • fromCollection
    Create a key set from a collection of keys.
  • tryGetIndex
    Get the index for a key.
  • size
    Get the domain size of this set.
  • getKey
    Get the key at an index.
  • keySet
    Get a view of the index as a set.
  • create
    Create a key set with some keys. All keys are initially active.
  • keyIterator
    Create an iterator over keys.
  • findLowerBound
    Get the lower bound, the first index whose key is greater than or equal to the specified key. This m
  • findUpperBound
    Get the upper bound, the first index whose key is greater than the specified key.
  • getLowerBound
    Get the lower bound of this index.
  • subIndex
    Create a view of a subset of this index.
  • wrap
    Wrap a key array (with a specified size) into a key set.
  • subIndex,
  • wrap,
  • containsKey,
  • fromIterator,
  • empty,
  • getKeyList

Popular in Java

  • Running tasks concurrently on multiple threads
  • setScale (BigDecimal)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • addToBackStack (FragmentTransaction)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • 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