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

How to use
removeAll
method
in
java.util.Collection

Best Java code snippets using java.util.Collection.removeAll (Showing top 20 results out of 6,840)

Refine searchRefine arrow

  • Collection.isEmpty
origin: neo4j/neo4j

private static Map<Direction, RelationshipType[]> toTypeMap(
    Map<Direction, Collection<RelationshipType>> tempMap )
{
  // Remove OUT/IN where there is a BOTH
  Collection<RelationshipType> both = tempMap.get( Direction.BOTH );
  tempMap.get( Direction.OUTGOING ).removeAll( both );
  tempMap.get( Direction.INCOMING ).removeAll( both );
  // Convert into a final map
  Map<Direction, RelationshipType[]> map = new EnumMap<>( Direction.class );
  for ( Map.Entry<Direction, Collection<RelationshipType>> entry : tempMap.entrySet() )
  {
    if ( !entry.getValue().isEmpty() )
    {
      map.put( entry.getKey(), entry.getValue().toArray( new RelationshipType[entry.getValue().size()] ) );
    }
  }
  return map;
}
origin: apache/incubator-shardingsphere

/**
 * Get slave data source names.
 *
 * @return available slave data source names
 */
@Override
public Collection<String> getSlaveDataSourceNames() {
  if (disabledDataSourceNames.isEmpty()) {
    return super.getSlaveDataSourceNames();
  }
  Collection<String> result = new LinkedList<>(super.getSlaveDataSourceNames());
  result.removeAll(disabledDataSourceNames);
  return result;
}

origin: Karumi/Dexter

private void onPermissionsChecked(Collection<String> permissions) {
 if (pendingPermissions.isEmpty()) {
  return;
 }
 synchronized (pendingPermissionsMutex) {
  pendingPermissions.removeAll(permissions);
  if (pendingPermissions.isEmpty()) {
   activity.finish();
   activity = null;
   isRequestingPermission.set(false);
   rationaleAccepted.set(false);
   isShowingNativeDialog.set(false);
   MultiplePermissionsListener currentListener = listener;
   listener = EMPTY_LISTENER;
   currentListener.onPermissionsChecked(multiplePermissionsReport);
  }
 }
}
origin: apache/ignite

Collection<File> deletedFiles = new HashSet<>(tstampCache.keySet());
deletedFiles.removeAll(foundFiles);
if (!deletedFiles.isEmpty()) {
  List<String> uris = new ArrayList<>();
origin: apache/hive

private void processAlias(MapWork work, Path path,
  Collection<String> aliasesAffected, Set<String> aliases) {
 // the aliases that are allowed to map to a null scan.
 Collection<String> allowed = aliasesAffected.stream()
   .filter(a -> aliases.contains(a)).collect(Collectors.toList());
 if (!allowed.isEmpty()) {
  PartitionDesc partDesc = work.getPathToPartitionInfo().get(path).clone();
  PartitionDesc newPartition =
    changePartitionToMetadataOnly(partDesc, path);
  // Prefix partition with something to avoid it being a hidden file.
  Path fakePath =
    new Path(NullScanFileSystem.getBase() + newPartition.getTableName()
      + "/part" + encode(newPartition.getPartSpec()));
  StringInternUtils.internUriStringsInPath(fakePath);
  work.addPathToPartitionInfo(fakePath, newPartition);
  work.addPathToAlias(fakePath, new ArrayList<>(allowed));
  aliasesAffected.removeAll(allowed);
  if (aliasesAffected.isEmpty()) {
   work.removePathToAlias(path);
   work.removePathToPartitionInfo(path);
  }
 }
}
origin: apache/storm

executorsNotScheduled.removeAll(scheduledTasks);
if (!executorsNotScheduled.isEmpty()) {
  LOG.warn("Scheduling {} left over task (most likely sys tasks)", executorsNotScheduled);
  executorsNotScheduled.removeAll(scheduledTasks);
executorsNotScheduled.removeAll(scheduledTasks);
if (executorsNotScheduled.size() > 0) {
  LOG.error("Not all executors successfully scheduled: {}", executorsNotScheduled);
origin: apache/ignite

/**
 * Perform scan.
 *
 * @param scanCtx Scan context.
 */
private void scan(UriDeploymentScannerContext scanCtx) {
  Collection<String> foundFiles = U.newHashSet(tstampCache.size());
  long start = U.currentTimeMillis();
  processHttp(foundFiles, scanCtx);
  if (scanCtx.getLogger().isDebugEnabled())
    scanCtx.getLogger().debug("HTTP scanner time in ms: " + (U.currentTimeMillis() - start));
  if (!scanCtx.isFirstScan()) {
    Collection<String> deletedFiles = new HashSet<>(tstampCache.keySet());
    deletedFiles.removeAll(foundFiles);
    if (!deletedFiles.isEmpty()) {
      List<String> uris = new ArrayList<>();
      for (String file : deletedFiles)
        uris.add(getFileUri(fileName(file), scanCtx));
      tstampCache.keySet().removeAll(deletedFiles);
      scanCtx.getListener().onDeletedFiles(uris);
    }
  }
}
origin: google/error-prone

     .collect(toImmutableList());
 worklist.addAll(overrides);
 clash.removeAll(overrides);
if (!clash.isEmpty()) {
origin: stackoverflow.com

 if (deque.isEmpty()) { 
  throw new NoSuchElementException("empty stack");
 if (deque.isEmpty()) { 
  throw new NoSuchElementException("empty stack");
{  return deque.isEmpty(); }
{ return deque.removeAll(c); }
origin: tjake/Solandra

if (!columns.isEmpty())
      columns.removeAll(columnsToRemove);
    if (!columns.isEmpty())
origin: apache/ignite

assert set.removeAll(c);
assert !set.removeAll(c);
assert set.isEmpty();
assert set.isEmpty();
origin: apache/ignite

/**
 * This test performs complex set of operations on store from multiple threads.
 *
 * @throws Exception If failed.
 */
private void testPutGetRemove(boolean writeCoalescing) throws Exception {
  initStore(2, writeCoalescing);
  Set<Integer> exp;
  try {
    exp = runPutGetRemoveMultithreaded(10, 10);
  }
  finally {
    shutdownStore();
  }
  Map<Integer, String> map = delegate.getMap();
  Collection<Integer> extra = new HashSet<>(map.keySet());
  extra.removeAll(exp);
  assertTrue("The underlying store contains extra keys: " + extra, extra.isEmpty());
  Collection<Integer> missing = new HashSet<>(exp);
  missing.removeAll(map.keySet());
  assertTrue("Missing keys in the underlying store: " + missing, missing.isEmpty());
  for (Integer key : exp)
    assertEquals("Invalid value for key " + key, "val" + key, map.get(key));
}
origin: hibernate/hibernate-orm

while ( !toProcessEntities.isEmpty() ) {
  Set<MetaEntity> processedEntities = new HashSet<MetaEntity>();
  int toProcessCountBeforeLoop = toProcessEntities.size();
    processedEntities.add( entity );
  toProcessEntities.removeAll( processedEntities );
  if ( toProcessEntities.size() >= toProcessCountBeforeLoop ) {
    context.logMessage(
origin: apache/kylin

if (!unmatchedAggregations.isEmpty()) {
  removeUnmatchedGroupingAgg(unmatchedAggregations);
  tryDimensionAsMeasures(unmatchedAggregations, result,
  if (!unmatchedAggregations.isEmpty()) {
    Iterator<FunctionDesc> itr = unmatchedAggregations.iterator();
    while (itr.hasNext()) {
  if (!unmatchedDimensions.isEmpty()) {
    unmatchedDimensions.removeAll(dimCols);
origin: apache/ignite

Collection<Integer> cp = new HashSet<>(original);
cp.removeAll(linkedMap.keySet());
assertTrue("Keys disappeared from map: " + cp, cp.isEmpty());
origin: apache/ignite

extra.removeAll(exp);
assertTrue("The underlying store contains extra keys: " + extra, extra.isEmpty());
missing.removeAll(map.keySet());
assertTrue("Missing keys in the underlying store: " + missing, missing.isEmpty());
origin: go-lang-plugin-org/go-lang-idea-plugin

private void doTestVariantsInner(@NotNull CompletionType type, int count, CheckType checkType, String... variants) {
 myFixture.complete(type, count);
 List<String> stringList = myFixture.getLookupElementStrings();
 assertNotNull("\nPossibly the single variant has been completed.\nFile after:\n" + myFixture.getFile().getText(), stringList);
 Collection<String> varList = ContainerUtil.newArrayList(variants);
 if (checkType == CheckType.ORDERED_EQUALS) {
  UsefulTestCase.assertOrderedEquals(stringList, variants);
 }
 else if (checkType == CheckType.EQUALS) {
  UsefulTestCase.assertSameElements(stringList, variants);
 }
 else if (checkType == CheckType.INCLUDES) {
  varList.removeAll(stringList);
  assertTrue("Missing variants: " + varList, varList.isEmpty());
 }
 else if (checkType == CheckType.EXCLUDES) {
  varList.retainAll(stringList);
  assertTrue("Unexpected variants: " + varList, varList.isEmpty());
 }
}
origin: apache/ignite

expOnly.removeAll(cacheKeys);
cacheOnly.removeAll(expVals.keySet());
if (!expOnly.isEmpty())
  log.error("Cache does not contain expected keys: " + expOnly);
if (!cacheOnly.isEmpty())
  log.error("Cache does contain unexpected keys: " + cacheOnly);
expOnly.removeAll(dhtCacheKeys);
cacheOnly.removeAll(expVals.keySet());
if (!expOnly.isEmpty())
  log.error("DHT cache does not contain expected keys: " + expOnly);
origin: apache/ignite

original.removeAll(keys);
assertTrue("Keys must be in map: " + original, original.isEmpty());
origin: apache/ignite

extra.removeAll(exp);
assertTrue("The underlying store contains extra keys: " + extra, extra.isEmpty());
missing.removeAll(map.keySet());
assertTrue("Missing keys in the underlying store: " + missing, missing.isEmpty());
java.utilCollectionremoveAll

Javadoc

Removes all occurrences in this Collection of each object in the specified Collection (optional). After this method returns none of the elements in the passed Collection can be found in this Collectionanymore.

Popular methods of Collection

  • size
    Returns the number of elements in this collection. If this collection contains more than Integer.MAX
  • iterator
    Returns an iterator over the elements in this collection. There are no guarantees concerning the ord
  • add
  • isEmpty
    Returns true if this collection contains no elements.
  • contains
  • toArray
  • stream
  • addAll
  • forEach
  • remove
  • clear
  • containsAll
  • clear,
  • containsAll,
  • equals,
  • hashCode,
  • retainAll,
  • removeIf,
  • parallelStream,
  • spliterator,
  • <init>

Popular in Java

  • Making http post requests using okhttp
  • getSystemService (Context)
  • setRequestProperty (URLConnection)
  • getContentResolver (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • JLabel (javax.swing)
  • Option (scala)
  • From CI to AI: The AI layer in your organization
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