IntHashSet.add
Code IndexAdd Codota to your IDE (free)

Best code snippets using com.carrotsearch.hppc.IntHashSet.add(Showing top 15 results out of 315)

origin: carrotsearch/hppc

@Override
public void bulkAdd(int[] keys) {
 for (int key : keys) {
  delegate.add(key);
 }
}
origin: sirensolutions/siren-join

@Override
public void readFrom(StreamInput in) throws IOException {
 this.setIsPruned(in.readBoolean());
 int size = in.readInt();
 set = new CircuitBreakerIntHashSet(size);
 for (long i = 0; i < size; i++) {
  set.add(in.readVInt());
 }
}
origin: mikvor/hashmapTest

  public static void main(String[] args) {
    final long start = System.currentTimeMillis();

    final IntHashSet a = new com.carrotsearch.hppc.IntHashSet();
    for( int i = 10000000; i-- != 0; ) a.add(i);
    IntHashSet b = new com.carrotsearch.hppc.IntHashSet(a.size());
    b.addAll(a);
    b = new com.carrotsearch.hppc.IntHashSet();
    b.addAll(a);

    final long time = System.currentTimeMillis() - start;
    System.out.println( time / 1000.0 );
    System.out.println( b.size() );
  }
}
origin: neo4j-contrib/neo4j-graph-algorithms

private void relax(int nodeId) {
  IntHashSet connected = new IntHashSet();
  int w;
  do {
    w = stack.pop();
    onStack.clear(w);
    connected.add(w);
  } while (w != nodeId);
  connectedComponents.add(connected);
  int size = connected.size();
  if (size < minSetSize) {
    minSetSize = size;
  }
  if (size > maxSetSize) {
    maxSetSize = size;
  }
}
origin: graphhopper/graphhopper

/**
 * This method makes edges crossing the specified border inaccessible to split a bigger area into smaller subnetworks.
 * This is important for the world wide use case to limit the maximum distance and also to detect unreasonable routes faster.
 */
protected IntHashSet findBorderEdgeIds(SpatialRuleLookup ruleLookup) {
  AllEdgesIterator allEdgesIterator = graph.getAllEdges();
  NodeAccess nodeAccess = graph.getNodeAccess();
  IntHashSet inaccessible = new IntHashSet();
  while (allEdgesIterator.next()) {
    int adjNode = allEdgesIterator.getAdjNode();
    SpatialRule ruleAdj = ruleLookup.lookupRule(nodeAccess.getLatitude(adjNode), nodeAccess.getLongitude(adjNode));
    int baseNode = allEdgesIterator.getBaseNode();
    SpatialRule ruleBase = ruleLookup.lookupRule(nodeAccess.getLatitude(baseNode), nodeAccess.getLongitude(baseNode));
    if (ruleAdj != ruleBase) {
      inaccessible.add(allEdgesIterator.getEdge());
    }
  }
  return inaccessible;
}
origin: neo4j-contrib/neo4j-graph-algorithms

private void relax(int nodeId) {
  IntHashSet connected = new IntHashSet();
  int w;
  do {
    w = stack.pop();
    onStack.clear(w);
    connected.add(w);
  } while (w != nodeId);
  processSCC(nodeId, connected);
}
origin: sirensolutions/siren-join

private void readFromBytes(BytesRef bytesRef) {
 // Read pruned flag
 this.setIsPruned(bytesRef.bytes[bytesRef.offset++] == 1 ? true : false);
 // Read size fo the set
 int size = Bytes.readInt(bytesRef);
 // Read terms
 // Scatter set is slightly more efficient than the hash set, but should be used only for lookups,
 // not for merging
 set = new IntScatterSet(size);
 for (int i = 0; i < size; i++) {
  set.add(Bytes.readVInt(bytesRef));
 }
}
origin: dremio/dremio-oss

outgoing.add(tp.getTo());
flattenVector = tp.getTo();
transferFieldIds.add(vectorRead.getFieldId().getFieldIds()[0]);
origin: carrotsearch/hppc

/**
 * Adds all elements from the given list (vararg) to this set. 
 * 
 * @return Returns the number of elements actually added as a result of this
 *         call (not previously present in the set).
 */
/*  */
public final int addAll(int... elements) {
 ensureCapacity(elements.length);
 int count = 0;
 for (int e : elements) {
  if (add(e)) {
   count++;
  }
 }
 return count;
}
origin: carrotsearch/hppc

@Override
public void add(int key) {
 delegate.add(key);
}
 
origin: sirensolutions/siren-join

@Override
public void add(long term) {
 this.set.add((int) term);
}
origin: carrotsearch/hppc

/**
 * Adds all elements from the given iterable to this set.
 * 
 * @return Returns the number of elements actually added as a result of this
 *         call (not previously present in the set).
 */
public int addAll(Iterable<? extends IntCursor> iterable) {
 int count = 0;
 for (IntCursor cursor : iterable) {
  if (add(cursor.value)) {
   count++;
  }
 }
 return count;
}
origin: com.carrotsearch/hppc

/**
 * Adds all elements from the given iterable to this set.
 * 
 * @return Returns the number of elements actually added as a result of this
 *         call (not previously present in the set).
 */
public int addAll(Iterable<? extends IntCursor> iterable) {
 int count = 0;
 for (IntCursor cursor : iterable) {
  if (add(cursor.value)) {
   count++;
  }
 }
 return count;
}
origin: com.carrotsearch/hppc

/**
 * Adds all elements from the given list (vararg) to this set. 
 * 
 * @return Returns the number of elements actually added as a result of this
 *         call (not previously present in the set).
 */
/*  */
public final int addAll(int... elements) {
 ensureCapacity(elements.length);
 int count = 0;
 for (int e : elements) {
  if (add(e)) {
   count++;
  }
 }
 return count;
}
origin: com.graphhopper/graphhopper-core

/**
 * This method makes edges crossing the specified border inaccessible to split a bigger area into smaller subnetworks.
 * This is important for the world wide use case to limit the maximum distance and also to detect unreasonable routes faster.
 */
protected IntHashSet findBorderEdgeIds(SpatialRuleLookup ruleLookup) {
  AllEdgesIterator allEdgesIterator = graph.getAllEdges();
  NodeAccess nodeAccess = graph.getNodeAccess();
  IntHashSet inaccessible = new IntHashSet();
  while (allEdgesIterator.next()) {
    int adjNode = allEdgesIterator.getAdjNode();
    SpatialRule ruleAdj = ruleLookup.lookupRule(nodeAccess.getLatitude(adjNode), nodeAccess.getLongitude(adjNode));
    int baseNode = allEdgesIterator.getBaseNode();
    SpatialRule ruleBase = ruleLookup.lookupRule(nodeAccess.getLatitude(baseNode), nodeAccess.getLongitude(baseNode));
    if (ruleAdj != ruleBase) {
      inaccessible.add(allEdgesIterator.getEdge());
    }
  }
  return inaccessible;
}
com.carrotsearch.hppcIntHashSetadd

Popular methods of IntHashSet

  • <init>
    New instance copying elements from another IntContainer.
  • contains
  • size
  • addAll
    Adds all elements from the given list (vararg) to this set.
  • allocateBuffers
    Allocate new internal buffers. This method attempts to allocate and assign internal buffers atomical
  • allocateThenInsertThenRehash
    This method is invoked when there is a new key to be inserted into the buffer but there is not enoug
  • ensureCapacity
    Ensure this container can hold at least the given number of elements without resizing its buffers.
  • hashKey
    Returns a hash code for the given key. The default implementation mixes the hash of the key with #ke
  • isEmpty
  • iterator
  • rehash
    Rehash from old buffers to new buffers.
  • release
  • rehash,
  • release,
  • remove,
  • sameKeys,
  • shiftConflictingKeys,
  • toArray,
  • verifyLoadFactor

Popular classes and methods

  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • getExternalFilesDir (Context)
  • onCreateOptionsMenu (Activity)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JButton (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Option (scala)

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)