Tabnine Logo
List.removeAll
Code IndexAdd Tabnine to your IDE (free)

How to use
removeAll
method
in
java.util.List

Best Java code snippets using java.util.List.removeAll (Showing top 20 results out of 22,356)

Refine searchRefine arrow

  • List.add
  • List.size
  • List.isEmpty
  • List.addAll
  • List.get
  • List.clear
origin: alexvasilkov/GestureViews

private void ensurePositionUpdateListenersRemoved() {
  listeners.removeAll(listenersToRemove);
  listenersToRemove.clear();
}
origin: apache/incubator-shardingsphere

  private static void dropColumnDefinitions(final Collection<String> droppedColumnNames, final List<ColumnMetaData> columnMetaDataList) {
    List<ColumnMetaData> droppedColumnMetaDataList = new LinkedList<>();
    for (ColumnMetaData each : columnMetaDataList) {
      if (droppedColumnNames.contains(each.getColumnName())) {
        droppedColumnMetaDataList.add(each);
      }
    }
    columnMetaDataList.removeAll(droppedColumnMetaDataList);
  }
}
origin: facebook/litho

private static void removeCompletedStateUpdatesFromMap(
  Map<String, List<StateUpdate>> currentStateUpdates,
  Map<String, List<StateUpdate>> completedStateUpdates,
  String key) {
 List<StateUpdate> completed = completedStateUpdates.get(key);
 List<StateUpdate> current = currentStateUpdates.remove(key);
 if (completed != null && current != null) {
  current.removeAll(completed);
 }
 if (current != null && !current.isEmpty()) {
  currentStateUpdates.put(key, current);
 }
}
origin: apache/hbase

private void updateFileLists(List<String> activeFiles, List<String> archiveFiles)
  throws IOException {
 List<String> newlyArchived = new ArrayList<>();
 for (String spath : activeFiles) {
  if (!fs.exists(new Path(spath))) {
   newlyArchived.add(spath);
  }
 }
 if (newlyArchived.size() > 0) {
  activeFiles.removeAll(newlyArchived);
  archiveFiles.addAll(newlyArchived);
 }
 LOG.debug(newlyArchived.size() + " files have been archived.");
}
origin: elasticjob/elastic-job-lite

private void removeRunningIfMonitorExecution(final boolean monitorExecution, final List<Integer> shardingItems) {
  if (!monitorExecution) {
    return;
  }
  List<Integer> runningShardingItems = new ArrayList<>(shardingItems.size());
  for (int each : shardingItems) {
    if (isRunning(each)) {
      runningShardingItems.add(each);
    }
  }
  shardingItems.removeAll(runningShardingItems);
}

origin: bluelinelabs/Conductor

@NonNull List<View> configureEnteringExitingViews(@NonNull Transition transition, @Nullable View view, @NonNull List<View> sharedElements, @NonNull View nonExistentView) {
  List<View> viewList = new ArrayList<>();
  if (view != null) {
    captureTransitioningViews(viewList, view);
  }
  viewList.removeAll(sharedElements);
  if (!viewList.isEmpty()) {
    viewList.add(nonExistentView);
    TransitionUtils.addTargets(transition, viewList);
  }
  return viewList;
}
origin: jiangqqlmj/FastDev4Android

private void refreshTitles(){
  List<String> newTitles=new ArrayList<String>();
  for(int i=0;i<5;i++){
    int index=i+1;
    newTitles.add("新数据是:"+index+"");
  }
  newTitles.addAll(mTitles);
  mTitles.removeAll(mTitles);
  mTitles.addAll(newTitles);
}
private void moreTitles(){
origin: stanfordnlp/CoreNLP

private static void removeSpuriousMentionsZhSimple(Annotation doc,
  List<List<Mention>> predictedMentions, Dictionaries dict) {
 for(int i=0 ; i < predictedMentions.size() ; i++) {
  List<Mention> mentions = predictedMentions.get(i);
  Set<Mention> remove = Generics.newHashSet();
  for(Mention m : mentions){
   if (m.originalSpan.size()==1 && m.headWord.tag().equals("CD")) {
    remove.add(m);
   }
   if (m.spanToString().contains("quot")) {
    remove.add(m);
   }
  }
  mentions.removeAll(remove);
 }
}
origin: Graylog2/graylog2-server

@Override
public void onEvent(RawMessageEvent event, long sequence, boolean endOfBatch) throws Exception {
  batch.add(event);
    log.debug("End of batch, journalling {} messages", batch.size());
    entries.removeAll(NULL_SINGLETON);
    batch.clear();
origin: alibaba/jstorm

  private List<ResourceWorkerSlot> getDifferNodeTaskWokers(String name) {
    List<ResourceWorkerSlot> workers = new ArrayList<>();
    workers.addAll(taskContext.getWorkerToTaskNum().keySet());

    for (Entry<String, List<ResourceWorkerSlot>> entry : taskContext.getSupervisorToWorker().entrySet()) {
      if (taskContext.getComponentNumOnSupervisor(entry.getKey(), name) != 0)
        workers.removeAll(entry.getValue());
    }
    if (workers.size() == 0) {
      throw new FailedAssignTopologyException("there's no enough supervisor for making component: " +
          name + " 's tasks on different node");
    }
    return workers;
  }
}
origin: stanfordnlp/CoreNLP

   log.info("duplicate found");
  LatticeWord twin = latticeWords.get(latticeWords.indexOf(lw));
  latticeWords.add(lw);
  if (oldEndTime != newEndTime) {
words.removeAll(toRemove);
origin: apache/nifi

  private void removeBins(final String key, final List<RecordBin> bins) {
    lock.lock();
    try {
      final List<RecordBin> list = groupBinMap.get(key);
      if (list != null) {
        final int initialSize = list.size();
        list.removeAll(bins);

        // Determine how many items were removed from the list and
        // update our binCount to keep track of this.
        final int removedCount = initialSize - list.size();
        binCount.addAndGet(-removedCount);

        if (list.isEmpty()) {
          groupBinMap.remove(key);
        }
      }
    } finally {
      lock.unlock();
    }
  }
}
origin: stackoverflow.com

 public static String[] clean(final String[] v) {
  List<String> list = new ArrayList<String>(Arrays.asList(v));
  list.removeAll(Collections.singleton(null));
  return list.toArray(new String[list.size()]);
}
origin: commons-collections/commons-collections

protected void verifyUnmodifiable(List list) {
  try {
    list.add(0, new Integer(0));
    fail("Expecting UnsupportedOperationException.");
  } catch (UnsupportedOperationException e) {
    list.add(new Integer(0));
     fail("Expecting UnsupportedOperationException.");
  } catch (UnsupportedOperationException e) {
    list.addAll(0, array);
     fail("Expecting UnsupportedOperationException.");
  } catch (UnsupportedOperationException e) {
    list.addAll(array);
     fail("Expecting UnsupportedOperationException.");
  } catch (UnsupportedOperationException e) {
    list.clear();
     fail("Expecting UnsupportedOperationException.");
  } catch (UnsupportedOperationException e) {
    list.removeAll(array);
     fail("Expecting UnsupportedOperationException.");
  } catch (UnsupportedOperationException e) {
origin: wildfly/wildfly

protected void suspect(Set<Address> suspects) {
  if(suspects == null)
    return;
  suspects.remove(local_addr);
  suspects.forEach(suspect -> suspect_history.add(String.format("%s: %s", new Date(), suspect)));
  suspected_mbrs.addAll(suspects);
  List<Address> eligible_mbrs=new ArrayList<>(this.members);
  eligible_mbrs.removeAll(suspected_mbrs);
  // Check if we're coord, then send up the stack
  if(local_addr != null && !eligible_mbrs.isEmpty() && local_addr.equals(eligible_mbrs.get(0))) {
    log.debug("%s: suspecting %s", local_addr, suspected_mbrs);
    up_prot.up(new Event(Event.SUSPECT, suspected_mbrs));
    down_prot.down(new Event(Event.SUSPECT, suspected_mbrs));
  }
}
origin: kiegroup/optaplanner

public List<T> mutate() {
  if (!canMutate()) {
    throw new IllegalStateException("No more mutations possible.");
  }
  if (removedIndex >= 0) {
    // last mutation was successful => clear the blacklist
    indexBlacklist.clear();
  }
  int blockSize = Math.max(list.size() / blockPortion, 1);
  if (indexBlacklist.size() == list.size() / blockSize && list.size() / blockPortion > 1) {
    // we've tried all blocks without success => try smaller blocks and clear the blacklist
    blockPortion *= 2;
    indexBlacklist.clear();
  }
  blockSize = Math.max(list.size() / blockPortion, 1);
  do {
    removedIndex = random.nextInt(list.size() / blockSize) * blockSize;
  } while (indexBlacklist.contains(removedIndex));
  removedBlock = new ArrayList<>(list.subList(removedIndex, removedIndex + blockSize));
  list.removeAll(removedBlock);
  return list;
}
origin: wildfly/wildfly

public void handleView(View view) {
  super.handleView(view);
  Address old_coord=coord;
  if(view.size() > 0) {
    coord=view.getCoord();
    is_coord=coord.equals(local_addr);
    log.debug("[%s] coord=%s, is_coord=%b", local_addr, coord, is_coord);
  }
  if(is_coord && num_backups > 0) {
    List<Address> new_backups=Util.pickNext(view.getMembers(), local_addr, num_backups);
    List<Address> copy_locks_list=null;
    synchronized(backups) {
      if(!backups.equals(new_backups)) {
        copy_locks_list=new ArrayList<>(new_backups);
        copy_locks_list.removeAll(backups);
        backups.clear();
        backups.addAll(new_backups);
      }
    }
    if(copy_locks_list != null && !copy_locks_list.isEmpty())
      copyLocksTo(copy_locks_list);
  }
  // For all non-acquired client locks, send the GRANT_LOCK request to the new coordinator (if changed)
  if(old_coord != null && !old_coord.equals(coord))
    client_lock_table.resendPendingLockRequests();
}
origin: wildfly/wildfly

/**
 * Computes pingable_mbrs (based on the current membership and the suspected members) and ping_dest
 * @param remove The member to be removed from pingable_mbrs
 */
@GuardedBy("lock")
protected void computePingDest(Address remove) {
  if(remove != null)
    pingable_mbrs.remove(remove);
  else {
    pingable_mbrs.clear();
    pingable_mbrs.addAll(members);
    pingable_mbrs.removeAll(bcast_task.getSuspectedMembers());
  }
  Address old_ping_dest=ping_dest;
  ping_dest=getPingDest(pingable_mbrs);
  if(Util.different(old_ping_dest, ping_dest)) {
    num_tries.set(1);
    last_ack=System.nanoTime();
  }
}
origin: jiangqqlmj/FastDev4Android

/**
 * 进行下拉刷新数据添加 并且刷新UI
 * @param pInstanceBeans
 */
public void addRefreshBeans(List<InstanceBean> pInstanceBeans){
   List<InstanceBean> temp=new ArrayList<InstanceBean>();
   temp.addAll(pInstanceBeans);
   temp.addAll(mInstanceBeans);
   mInstanceBeans.removeAll(mInstanceBeans);
   mInstanceBeans.addAll(temp);
   notifyDataSetChanged();
}
origin: GitLqr/LQRWeChat

public static void sortContacts(List<Friend> list) {
  Collections.sort(list);//排序后由于#号排在上面,故得把#号的部分集合移动到集合的最下面
  List<Friend> specialList = new ArrayList<>();
  for (int i = 0; i < list.size(); i++) {
    //将属于#号的集合分离开来
    if (list.get(i).getNameSpelling().equalsIgnoreCase("#")) {
      specialList.add(list.get(i));
    }
  }
  if (specialList.size() != 0) {
    list.removeAll(specialList);//先移出掉顶部的#号部分
    list.addAll(list.size(), specialList);//将#号的集合添加到集合底部
  }
}
java.utilListremoveAll

Javadoc

Removes all occurrences in this List of each object in the specified collection.

Popular methods of List

  • add
  • size
    Returns the number of elements in this List.
  • get
    Returns the element at the specified location in this List.
  • isEmpty
    Returns whether this List contains no elements.
  • addAll
  • toArray
    Returns an array containing all elements contained in this List. If the specified array is large eno
  • contains
    Tests whether this List contains the specified object.
  • remove
    Removes the first occurrence of the specified object from this List.
  • iterator
    Returns an iterator on the elements of this List. The elements are iterated in the same order as the
  • clear
  • stream
  • forEach
  • stream,
  • forEach,
  • set,
  • subList,
  • indexOf,
  • equals,
  • hashCode,
  • listIterator,
  • sort

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • startActivity (Activity)
  • getApplicationContext (Context)
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Top 12 Jupyter Notebook extensions
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