Tabnine Logo
AbstractLong2DoubleMap$BasicEntry
Code IndexAdd Tabnine to your IDE (free)

How to use
AbstractLong2DoubleMap$BasicEntry
in
it.unimi.dsi.fastutil.longs

Best Java code snippets using it.unimi.dsi.fastutil.longs.AbstractLong2DoubleMap$BasicEntry (Showing top 20 results out of 315)

origin: it.unimi.dsi/fastutil

  /** {@inheritDoc} */
  @Override
  public void fastForEach(final Consumer<? super Long2DoubleMap.Entry> consumer) {
    final AbstractLong2DoubleMap.BasicEntry entry = new AbstractLong2DoubleMap.BasicEntry();
    if (containsNullKey) {
      entry.key = key[n];
      entry.value = value[n];
      consumer.accept(entry);
    }
    for (int pos = n; pos-- != 0;)
      if (!((key[pos]) == (0))) {
        entry.key = key[pos];
        entry.value = value[pos];
        consumer.accept(entry);
      }
  }
}
origin: it.unimi.dsi/fastutil

@Override
public ObjectIterator<Long2DoubleMap.Entry> fastIterator() {
  return new ObjectIterator<Long2DoubleMap.Entry>() {
    int next = 0, curr = -1;
    final BasicEntry entry = new BasicEntry();
    @Override
    public boolean hasNext() {
      return next < size;
    }
    @Override
    public Entry next() {
      if (!hasNext())
        throw new NoSuchElementException();
      entry.key = key[curr = next];
      entry.value = value[next++];
      return entry;
    }
    @Override
    public void remove() {
      if (curr == -1)
        throw new IllegalStateException();
      curr = -1;
      final int tail = size-- - next--;
      System.arraycopy(key, next + 1, key, next, tail);
      System.arraycopy(value, next + 1, value, next, tail);
    }
  };
}
@Override
origin: org.lenskit/lenskit-core

private Entry entry(int idx) {
  return new BasicEntry(keys.getKey(idx), values[idx]);
}
origin: it.unimi.dsi/fastutil

  /** {@inheritDoc} */
  @Override
  public void fastForEach(final Consumer<? super Long2DoubleMap.Entry> consumer) {
    final AbstractLong2DoubleMap.BasicEntry entry = new AbstractLong2DoubleMap.BasicEntry();
    if (containsNullKey) {
      entry.key = key[n];
      entry.value = value[n];
      consumer.accept(entry);
    }
    for (int pos = n; pos-- != 0;)
      if (!((key[pos]) == (0))) {
        entry.key = key[pos];
        entry.value = value[pos];
        consumer.accept(entry);
      }
  }
}
origin: it.unimi.dsi/fastutil

  /** {@inheritDoc} */
  @Override
  public void fastForEach(final Consumer<? super Long2DoubleMap.Entry> consumer) {
    final AbstractLong2DoubleMap.BasicEntry entry = new AbstractLong2DoubleMap.BasicEntry();
    for (int i = size, curr, next = first; i-- != 0;) {
      curr = next;
      next = (int) link[curr];
      entry.key = key[curr];
      entry.value = value[curr];
      consumer.accept(entry);
    }
  }
}
origin: org.lenskit/lenskit-core

  @Override
  public Long2DoubleMap.Entry next() {
    Result r = results.next();
    return new AbstractLong2DoubleMap.BasicEntry(r.getId(), r.getScore());
  }
}
origin: org.lenskit/lenskit-core

@Override
public Long2DoubleMap.Entry previous() {
  Result r = results.previous();
  return new AbstractLong2DoubleMap.BasicEntry(r.getId(), r.getScore());
}
origin: org.grouplens.lenskit/lenskit-data-structures

  @Override
  public Entry next() {
    VectorEntry e = delegate.next();
    return new BasicEntry(e.getKey(), e.getValue());
  }
}
origin: org.lenskit/lenskit-core

@Override
public Long2DoubleMap.Entry first() {
  if (delegate.isEmpty()) {
    throw new NoSuchElementException();
  } else {
    long k = delegate.firstLongKey();
    return new AbstractLong2DoubleMap.BasicEntry(k, getScore(k));
  }
}
origin: it.unimi.dsi/fastutil

/** {@inheritDoc} */
@Override
public void forEach(final Consumer<? super Long2DoubleMap.Entry> consumer) {
  for (int i = size, curr, next = first; i-- != 0;) {
    curr = next;
    next = (int) link[curr];
    consumer.accept(new AbstractLong2DoubleMap.BasicEntry(key[curr], value[curr]));
  }
}
/** {@inheritDoc} */
origin: it.unimi.dsi/fastutil

@Override
public LongBidirectionalIterator iterator(final long from) {
  return new KeySetIterator(long2DoubleEntrySet().iterator(new BasicEntry(from, (0))));
}
@Override
origin: it.unimi.dsi/fastutil

@Override
public Entry next() {
  if (!hasNext())
    throw new NoSuchElementException();
  return new AbstractLong2DoubleMap.BasicEntry(key[curr = next], value[next++]);
}
@Override
origin: org.lenskit/lenskit-core

  @Override
  public Long2DoubleMap.Entry last() {
    if (delegate.isEmpty()) {
      throw new NoSuchElementException();
    } else {
      long k = delegate.lastLongKey();
      return new AbstractLong2DoubleMap.BasicEntry(k, getScore(k));
    }
  }
}
origin: it.unimi.dsi/fastutil

@Override
public ObjectSortedSet<Long2DoubleMap.Entry> long2DoubleEntrySet() {
  if (entries == null)
    entries = ObjectSortedSets.singleton(new AbstractLong2DoubleMap.BasicEntry(key, value),
        entryComparator(comparator));
  return (ObjectSortedSet<Long2DoubleMap.Entry>) entries;
}
/**
origin: it.unimi.dsi/fastutil

/** {@inheritDoc} */
@Override
public void forEach(final Consumer<? super Long2DoubleMap.Entry> consumer) {
  if (containsNullKey)
    consumer.accept(new AbstractLong2DoubleMap.BasicEntry(key[n], value[n]));
  for (int pos = n; pos-- != 0;)
    if (!((key[pos]) == (0)))
      consumer.accept(new AbstractLong2DoubleMap.BasicEntry(key[pos], value[pos]));
}
/** {@inheritDoc} */
origin: it.unimi.dsi/fastutil

@Override
public ObjectSet<Long2DoubleMap.Entry> long2DoubleEntrySet() {
  if (entries == null)
    entries = ObjectSets.singleton(new AbstractLong2DoubleMap.BasicEntry(key, value));
  return entries;
}
/**
origin: it.unimi.dsi/fastutil

/** {@inheritDoc} */
@Override
public void forEach(final Consumer<? super Long2DoubleMap.Entry> consumer) {
  if (containsNullKey)
    consumer.accept(new AbstractLong2DoubleMap.BasicEntry(key[n], value[n]));
  for (int pos = n; pos-- != 0;)
    if (!((key[pos]) == (0)))
      consumer.accept(new AbstractLong2DoubleMap.BasicEntry(key[pos], value[pos]));
}
/** {@inheritDoc} */
origin: lenskit/lenskit

@Test
public void testFastIterStartFrom() {
  double[] values = { 1.5, 2.4, -3.2, 4.3, -5.7 };
  Long2DoubleSortedArrayMap map = new Long2DoubleSortedArrayMap(SortedKeyIndex.create(1, 2, 3, 4, 5),
                                 values);
  AbstractLong2DoubleMap.BasicEntry key = new AbstractLong2DoubleMap.BasicEntry(2, 2.0);
  ObjectBidirectionalIterator<Long2DoubleMap.Entry> iter = map.long2DoubleEntrySet().fastIterator(key);
  assertThat(iter.next().getLongKey(), equalTo(3L));
  assertThat(iter.previous().getLongKey(), equalTo(3L));
  assertThat(iter.previous().getLongKey(), equalTo(2L));
}
origin: lenskit/lenskit

  @Override
  public Long2DoubleMap.Entry next() {
    Result r = results.next();
    return new AbstractLong2DoubleMap.BasicEntry(r.getId(), r.getScore());
  }
}
origin: lenskit/lenskit

@Override
public Long2DoubleMap.Entry first() {
  if (delegate.isEmpty()) {
    throw new NoSuchElementException();
  } else {
    long k = delegate.firstLongKey();
    return new AbstractLong2DoubleMap.BasicEntry(k, getScore(k));
  }
}
it.unimi.dsi.fastutil.longsAbstractLong2DoubleMap$BasicEntry

Javadoc

This class provides a basic but complete type-specific entry class for all those maps implementations that do not have entries on their own (e.g., most immutable maps).

This class does not implement java.util.Map.Entry#setValue(Object), as the modification would not be reflected in the base map.

Most used methods

  • <init>

Popular in Java

  • Making http requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top plugins for WebStorm
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