Tabnine Logo
HashSet.addAll
Code IndexAdd Tabnine to your IDE (free)

How to use
addAll
method
in
java.util.HashSet

Best Java code snippets using java.util.HashSet.addAll (Showing top 20 results out of 10,998)

Refine searchRefine arrow

  • HashSet.add
  • Arrays.asList
  • HashSet.size
  • Iterator.next
  • HashSet.<init>
origin: prestodb/presto

private static Set<String> _merge(Set<String> s1, Set<String> s2)
{
  if (s1.isEmpty()) {
    return s2;
  } else if (s2.isEmpty()) {
    return s1;
  }
  HashSet<String> result = new HashSet<String>(s1.size() + s2.size());
  result.addAll(s1);
  result.addAll(s2);
  return result;
}
origin: apache/flink

private FieldSet(FieldSet fieldSet, int... fieldIDs) {
  if (fieldIDs == null || fieldIDs.length == 0) {
    this.collection = fieldSet.collection;
  } else {
    HashSet<Integer> set = new HashSet<Integer>(2 * (fieldSet.collection.size() + fieldIDs.length));
    set.addAll(fieldSet.collection);
    
    for (int i = 0; i < fieldIDs.length; i++) {
      set.add(fieldIDs[i]);
    }
    
    this.collection = Collections.unmodifiableSet(set);
  }
}

origin: apache/hive

@SuppressWarnings("unchecked")
public void setNodeTypes(Class<? extends Node> ...nodeTypes) {
 this.nodeTypes.addAll(Arrays.asList(nodeTypes));
}
origin: neo4j/neo4j

  private IndexLimitation[] limitationsUnion( Iterable<IndexCapability> capabilities )
  {
    HashSet<IndexLimitation> union = new HashSet<>();
    for ( IndexCapability capability : capabilities )
    {
      union.addAll( Arrays.asList( capability.limitations() ) );
    }
    return union.toArray( new IndexLimitation[union.size()] );
  }
}
origin: apache/geode

private Set<Integer> calculateRetryBuckets() {
 Iterator<Map.Entry<InternalDistributedMember, List<Integer>>> memberToBucketList =
   node2bucketIds.entrySet().iterator();
 final HashSet<Integer> retryBuckets = new HashSet<Integer>();
 while (memberToBucketList.hasNext()) {
  Map.Entry<InternalDistributedMember, List<Integer>> e = memberToBucketList.next();
  InternalDistributedMember m = e.getKey();
  if (!this.resultsPerMember.containsKey(m)
    || (!((MemberResultsList) this.resultsPerMember.get(m)).isLastChunkReceived())) {
   retryBuckets.addAll(e.getValue());
   this.resultsPerMember.remove(m);
  }
 }
 if (logger.isDebugEnabled()) {
  StringBuffer logStr = new StringBuffer();
  logStr.append("Query ").append(this.query.getQueryString())
    .append(" needs to retry bucketsIds: [");
  for (Integer i : retryBuckets) {
   logStr.append("," + i);
  }
  logStr.append("]");
  logger.debug(logStr);
 }
 return retryBuckets;
}
origin: robolectric/robolectric

public void setFeatures(Account account, String[] accountFeatures) {
 HashSet<String> featureSet = new HashSet<>();
 featureSet.addAll(Arrays.asList(accountFeatures));
 this.accountFeatures.put(account, featureSet);
}
origin: apache/storm

public static Collection<Node> takeNodes(int nodesNeeded, NodePool[] pools) {
  LOG.debug("Trying to grab {} free nodes from {}", nodesNeeded, pools);
  HashSet<Node> ret = new HashSet<>();
  for (NodePool pool : pools) {
    Collection<Node> got = pool.takeNodes(nodesNeeded);
    ret.addAll(got);
    nodesNeeded -= got.size();
    LOG.debug("Got {} nodes so far need {} more nodes", ret.size(), nodesNeeded);
    if (nodesNeeded <= 0) {
      break;
    }
  }
  return ret;
}
origin: alibaba/mdrill

Entry<String, SupervisorInfo> entry = it.next();
String supervisorId = entry.getKey();
SupervisorInfo info = entry.getValue();
Entry<String, StormBase> entry = it.next();
String stormId = entry.getKey();
StormBase base = entry.getValue();
Assignment assignment = stormClusterState.assignment_info(stormId,null);
if (assignment != null) {
  HashSet<NodePort> workers = new HashSet<NodePort>();
  Collection<NodePort> entryColl = assignment.getTaskToNodeport().values();
  workers.addAll(entryColl);
  topologySummaries.add(new TopologySummary(stormId, base.getStormName(), assignment.getTaskToNodeport().size(),
      workers.size(), TimeUtils.time_delta(base
          .getLanchTimeSecs()), extractStatusStr(base)));
origin: Sable/soot

outset.addAll(inset);
  Iterator keyIt = keylist.iterator();
  while (keyIt.hasNext()) {
   Object key = keyIt.next();
   if (key instanceof ArrayRef) {
    outset.remove(key);
   Iterator keyIt = keylist.iterator();
   while (keyIt.hasNext()) {
    Object key = keyIt.next();
    if (key instanceof ArrayRef) {
     Value base = ((ArrayRef) key).getBase();
 if (condset == null || (condset.size() == 0)) {
  outset.addAll(genset);
 } else {
  Iterator condIt = condset.iterator();
  while (condIt.hasNext()) {
   if (inset.contains(condIt.next())) {
    outset.addAll(genset);
    break;
 outset.addAll(absgenset);
origin: com.h2database/h2

/**
 * Add all objects that this table depends on to the hash set.
 *
 * @param dependencies the current set of dependencies
 */
public void addDependencies(HashSet<DbObject> dependencies) {
  if (dependencies.contains(this)) {
    // avoid endless recursion
    return;
  }
  if (sequences != null) {
    dependencies.addAll(sequences);
  }
  ExpressionVisitor visitor = ExpressionVisitor.getDependenciesVisitor(
      dependencies);
  for (Column col : columns) {
    col.isEverything(visitor);
  }
  if (constraints != null) {
    for (Constraint c : constraints) {
      c.isEverything(visitor);
    }
  }
  dependencies.add(this);
}
origin: apache/kylin

public boolean isNeedStorageAggregation(Cuboid cuboid, Collection<TblColRef> groupD,
    Collection<TblColRef> singleValueD) {
  HashSet<TblColRef> temp = Sets.newHashSet();
  temp.addAll(groupD);
  temp.addAll(singleValueD);
  if (cuboid.getColumns().size() == temp.size()) {
    logger.debug("Does not need storage aggregation");
    return false;
  } else {
    logger.debug("Need storage aggregation");
    return true;
  }
}
origin: hibernate/hibernate-orm

Iterator<String> columnAliasIter = columnAliases.iterator();
HashSet<String> columnsUnique = new HashSet<String>();
if (usedAliases!=null) {
  columnsUnique.addAll( Arrays.asList(usedAliases) );
  String column = iter.next();
  String columnAlias = columnAliasIter.next();
  if ( columnsUnique.add(columnAlias) ) {
    buf.append(", ")
      .append(column)
origin: Sable/soot

public void find_StatementSequences(SequenceFinder sf, DavaBody davaBody) {
 Iterator<IterableSet> sbit = subBodies.iterator();
 while (sbit.hasNext()) {
  IterableSet body = sbit.next();
  IterableSet children = body2childChain.get(body);
  HashSet<AugmentedStmt> childUnion = new HashSet<AugmentedStmt>();
  Iterator cit = children.iterator();
  while (cit.hasNext()) {
   SETNode child = (SETNode) cit.next();
   child.find_StatementSequences(sf, davaBody);
   childUnion.addAll(child.get_Body());
  }
  sf.find_StatementSequences(this, body, childUnion, davaBody);
 }
}
origin: hibernate/hibernate-orm

private static Set<String> buildContraintCategories() {
  HashSet<String> categories = new HashSet<String>();
  categories.addAll(
      Arrays.asList(
          "23",	// "integrity constraint violation"
          "27",	// "triggered data change violation"
          "44"	// "with check option violation"
      )
  );
  return Collections.unmodifiableSet( categories );
}
origin: apache/flink

/**
 * @param fieldSet The first part of the new set, NOT NULL!
 * @param fieldID The ID to be added, NOT NULL!
 */
private FieldSet(FieldSet fieldSet, Integer fieldID) {
  if (fieldSet.size() == 0) {
    this.collection = Collections.singleton(fieldID);
  }
  else {
    HashSet<Integer> set = new HashSet<Integer>(2 * (fieldSet.collection.size() + 1));
    set.addAll(fieldSet.collection);
    set.add(fieldID);
    this.collection = Collections.unmodifiableSet(set);
  }
}

origin: alibaba/jstorm

public static Collection<Node> takeNodes(int nodesNeeded, NodePool[] pools) {
  LOG.debug("Trying to grab {} free nodes from {}", nodesNeeded, pools);
  HashSet<Node> ret = new HashSet<>();
  for (NodePool pool : pools) {
    Collection<Node> got = pool.takeNodes(nodesNeeded);
    ret.addAll(got);
    nodesNeeded -= got.size();
    LOG.debug("Got {} nodes so far need {} more nodes", ret.size(), nodesNeeded);
    if (nodesNeeded <= 0) {
      break;
    }
  }
  return ret;
}
origin: redisson/redisson

private static Set<String> _merge(Set<String> s1, Set<String> s2)
{
  if (s1.isEmpty()) {
    return s2;
  } else if (s2.isEmpty()) {
    return s1;
  }
  HashSet<String> result = new HashSet<String>(s1.size() + s2.size());
  result.addAll(s1);
  result.addAll(s2);
  return result;
}
origin: Sable/soot

TransitiveTargets tt = new TransitiveTargets(cg);
statement: for (Iterator sIt = body.getUnits().iterator(); sIt.hasNext();) {
 final Stmt s = (Stmt) sIt.next();
 HashSet read = new HashSet();
 HashSet write = new HashSet();
 Iterator<MethodOrMethodContext> it = tt.iterator(s);
 while (it.hasNext()) {
  SootMethod target = (SootMethod) it.next();
  ensureProcessed(target);
  if (target.isNative()) {
   continue statement;
  read.addAll(methodToRead.get(target));
  write.addAll(methodToWrite.get(target));
  if (read.size() + write.size() > threshold) {
   continue statement;
origin: apache/drill

@SuppressWarnings("unchecked")
public void setNodeTypes(Class<? extends Node> ...nodeTypes) {
 this.nodeTypes.addAll(Arrays.asList(nodeTypes));
}
origin: fesh0r/fernflower

public HashSet<Statement> buildContinueSet() {
 continueSet.clear();
 for (Statement st : stats) {
  continueSet.addAll(st.buildContinueSet());
  if (st != first) {
   continueSet.remove(st.getBasichead());
  }
 }
 for (StatEdge edge : getEdges(StatEdge.TYPE_CONTINUE, DIRECTION_FORWARD)) {
  continueSet.add(edge.getDestination().getBasichead());
 }
 if (type == TYPE_DO) {
  continueSet.remove(first.getBasichead());
 }
 return continueSet;
}
java.utilHashSetaddAll

Popular methods of HashSet

  • <init>
  • add
    Adds the specified element to this set if it is not already present. More formally, adds the specifi
  • contains
    Returns true if this set contains the specified element. More formally, returns true if and only if
  • size
    Returns the number of elements in this set (its cardinality).
  • remove
    Removes the specified element from this set if it is present. More formally, removes an element e su
  • iterator
    Returns an iterator over the elements in this set. The elements are returned in no particular order.
  • isEmpty
    Returns true if this set contains no elements.
  • clear
    Removes all of the elements from this set. The set will be empty after this call returns.
  • toArray
  • removeAll
  • equals
  • clone
    Returns a shallow copy of this HashSet instance: the elements themselves are not cloned.
  • equals,
  • clone,
  • retainAll,
  • stream,
  • containsAll,
  • forEach,
  • hashCode,
  • toString,
  • removeIf

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • compareTo (BigDecimal)
  • findViewById (Activity)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top Vim plugins
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