Tabnine Logo
ArrayList.retainAll
Code IndexAdd Tabnine to your IDE (free)

How to use
retainAll
method
in
java.util.ArrayList

Best Java code snippets using java.util.ArrayList.retainAll (Showing top 20 results out of 1,080)

origin: ltsopensource/light-task-scheduler

public boolean retainAll(Collection<?> c) {
  return list.retainAll(c);
}
origin: ltsopensource/light-task-scheduler

public boolean retainAll(Collection<?> c) {
  return list.retainAll(c);
}
origin: Sable/soot

/**
 * {@inheritDoc}
 */
public boolean retainAll(Collection c) {
 return worklist.retainAll(c);
}
origin: ReactiveX/RxJava

@Override
public boolean retainAll(Collection<?> c) {
  boolean b = list.retainAll(c);
  lazySet(list.size());
  return b;
}
origin: commons-collections/commons-collections

/**
 * Remove from this collection all of its elements except those that are
 * contained in the specified collection.
 *
 * @param collection Collection containing elements to be retained
 *
 * @exception UnsupportedOperationException if this optional operation
 *  is not supported by this list
 */
public boolean retainAll(Collection collection) {
  if (fast) {
    synchronized (this) {
      ArrayList temp = (ArrayList) list.clone();
      boolean result = temp.retainAll(collection);
      list = temp;
      return (result);
    }
  } else {
    synchronized (list) {
      return (list.retainAll(collection));
    }
  }
}
origin: apache/hbase

@Override
public synchronized boolean retainAll(Collection<?> c) {
 ArrayList<E> newList = new ArrayList<>(list);
 // Removals in ArrayList won't break sorting
 boolean changed = newList.retainAll(c);
 list = Collections.unmodifiableList(newList);
 return changed;
}
origin: wildfly/wildfly

/**
 * Remove from this collection all of its elements except those that are
 * contained in the specified collection.
 *
 * @param collection Collection containing elements to be retained
 *
 * @exception UnsupportedOperationException if this optional operation
 *  is not supported by this list
 */
public boolean retainAll(Collection collection) {
  if (fast) {
    synchronized (this) {
      ArrayList temp = (ArrayList) list.clone();
      boolean result = temp.retainAll(collection);
      list = temp;
      return (result);
    }
  } else {
    synchronized (list) {
      return (list.retainAll(collection));
    }
  }
}
origin: redisson/redisson

@Override
public boolean retainAll(Collection<?> c) {
  boolean b = list.retainAll(c);
  lazySet(list.size());
  return b;
}
origin: org.jsoup/jsoup

@Override
public boolean retainAll(Collection<?> c) {
  onContentsChanged();
  return super.retainAll(c);
}
origin: org.apache.avro/avro

public boolean retainAll(Collection<?> c) {
 ensureUnlocked();
 return super.retainAll(c);
}
origin: apache/avro

public boolean retainAll(Collection<?> c) {
 ensureUnlocked();
 return super.retainAll(c);
}
origin: igniterealtime/Smack

commonAudioPtsHere.retainAll(remoteAudioPts);
commonAudioPtsThere.retainAll(localAudioPts);
origin: jankotek/mapdb

ArrayList iteratedAndRemoved = new ArrayList(iterated);
ArrayList spliteratedAndRemoved = new ArrayList(spliterated);
iteratedAndRemoved.retainAll(removed);
spliteratedAndRemoved.retainAll(removed);
assertTrue(iteratedAndRemoved.size() <= 1);
assertTrue(spliteratedAndRemoved.size() <= 1);
origin: geotools/geotools

/**
 * Retains only the elements in this list that are contained in the specified collection.
 *
 * @throws UnsupportedOperationException if this collection is unmodifiable.
 */
@Override
public boolean retainAll(Collection<?> c) throws UnsupportedOperationException {
  synchronized (getLock()) {
    checkWritePermission();
    return super.retainAll(c);
  }
}
origin: org.netbeans.api/org-netbeans-modules-java-source-base

@Override
public boolean retainAll(Collection c) {
  Map<RelativePosition, List<Comment>> orig = trackFirstChange() ? getOrigMap() : null;
  boolean r = super.retainAll(c);
  if (orig != null && r) {
    origMap = orig;
  }
  changed |= r;
  return r;
}
origin: ibinti/bugvm

/**
 * {@inheritDoc}
 */
public boolean retainAll(Collection c) {
  return worklist.retainAll(c);
}
origin: org.netbeans.modules/org-netbeans-modules-dlight-indicators

private boolean hasInfoToPaint(TimeSeriesDescriptor graph, Collection<Column> providedColumns){
  TimeSeriesDescriptorAccessor accessor = TimeSeriesDescriptorAccessor.getDefault();
  if (providedColumns == null || providedColumns.isEmpty() ||
      accessor.getSourceColumns(graph) == null || accessor.getSourceColumns(graph) .isEmpty()){
    return true;
  }
  //if the  intersection is not empty - returns tru
  ArrayList<Column> list = new ArrayList<Column>(providedColumns);
  list.retainAll(accessor.getSourceColumns(graph));
  return !list.isEmpty();
}
origin: org.apache.openjpa/openjpa-kernel

public boolean retainAll(Collection paramCollection) {
  if (_directAccess) {
    return super.retainAll(paramCollection);
  }
  if (isDelayLoad()) {
    load();
  }
  return ProxyCollections.retainAll(this, paramCollection);
}
origin: org.apache.openejb.patch/openjpa-kernel

public boolean retainAll(Collection paramCollection) {
  if (_directAccess) {
    return super.retainAll(paramCollection);
  }
  if (isDelayLoad()) {
    load();
  }
  return ProxyCollections.retainAll(this, paramCollection);
}
origin: org.seqdoop/htsjdk

@Override
public boolean retainAll(final Collection<?> objects) {
  checkImmutability();
  invalidateSampleNameMap();
  invalidateSampleOrdering();
  return getGenotypes().retainAll(objects);
}
java.utilArrayListretainAll

Javadoc

Retains only the elements in this list that are contained in the specified collection. In other words, removes from this list all of its elements that are not contained in the specified collection.

Popular methods of ArrayList

  • <init>
  • add
  • size
    Returns the number of elements in this ArrayList.
  • get
    Returns the element at the specified position in this list.
  • toArray
    Returns an array containing all of the elements in this list in proper sequence (from first to last
  • addAll
    Adds the objects in the specified collection to this ArrayList.
  • remove
    Removes the first occurrence of the specified element from this list, if it is present. If the list
  • clear
    Removes all elements from this ArrayList, leaving it empty.
  • isEmpty
    Returns true if this list contains no elements.
  • iterator
    Returns an iterator over the elements in this list in proper sequence.The returned iterator is fail-
  • contains
    Searches this ArrayList for the specified object.
  • set
    Replaces the element at the specified position in this list with the specified element.
  • contains,
  • set,
  • indexOf,
  • clone,
  • subList,
  • stream,
  • ensureCapacity,
  • trimToSize,
  • removeAll,
  • toString

Popular in Java

  • Start an intent from android
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getExternalFilesDir (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Github Copilot alternatives
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