APISonar


java.util.ArrayList.retainAll

> java > util > ArrayList > retainAll
java APIs util APIs ArrayList APIs retainAll APIs

Example 1
private ArrayList<T> mItems;

	public void retainAll(Collection<T> items) {
		mItems.retainAll(items);
		notifyDataSetChanged();
	}
Example 2
private ArrayList myArrayList;

	public boolean retainAll(Collection<?> c) {
		// TODO Auto-generated method stub
		return myArrayList.retainAll(c);
	}
Example 3
private ArrayList<Object>								list			= new ArrayList<Object>();

	public boolean retainAll(Collection<?> c) {
		convertAll();
		return list.retainAll(c);
	}
Example 4
private final ArrayList<T> objects;

	public boolean retainAll(final Collection<?> c) {
		final boolean changed = objects.retainAll(c);
		if (changed) announceStructureChange();
		return changed;
	}
Example 5
public synchronized boolean retainAll(Collection<?> c) {
    ArrayList<E> newList = new ArrayList<E>(list);
    // Removals in ArrayList won't break sorting
    boolean changed = newList.retainAll(c);
    list = Collections.unmodifiableList(newList);
    return changed;
  }
Example 6
private void verifyEmptyIntersection(int requiredId, int disallowedId) {
        ArrayList<String> required = getStringArrayInRealResources(requiredId);
        ArrayList<String> disallowed = getStringArrayInRealResources(disallowedId);
        required.retainAll(disallowed);
        assertTrue(required.isEmpty());
    }
Example 7
public boolean collectionSubtype(ArrayList<String> arrayList1, ArrayList<String> arrayList2) {
    boolean result = arrayList1.contains("ok");
    result &= arrayList1.contains(null);
    result &= arrayList1.remove("ok");
    result &= arrayList1.remove(null);
    result &= arrayList1.containsAll(arrayList2);
    result &= arrayList1.containsAll(null);
    result &= arrayList1.removeAll(arrayList2);
    result &= arrayList1.removeAll(null);
    result &= arrayList1.retainAll(arrayList2);
    return result && arrayList1.retainAll(null);
  }
Example 8
private ArrayList<QBUser> currentOpponentsList;

    private boolean isCurrentOpponentsListActual(ArrayList<QBUser> actualCurrentOpponentsList) {
        boolean equalActual = actualCurrentOpponentsList.retainAll(currentOpponentsList);
        boolean equalCurrent = currentOpponentsList.retainAll(actualCurrentOpponentsList);
        return !equalActual && !equalCurrent;
    }
Example 9
public void collectionSubtype(ArrayList<Integer> arrayList1, ArrayList<String> arrayList2) {
    // BUG: Diagnostic contains: Argument '"bad"' should not be passed to this method
    // its type String is not compatible with its collection's type argument Integer
    arrayList1.contains("bad");
    // BUG: Diagnostic contains:
    arrayList1.remove("bad");
    // BUG: Diagnostic contains: Argument 'arrayList2' should not be passed to this method
    // its type ArrayList<String> has a type argument String that is not compatible with its collection's type argument Integer
    arrayList1.containsAll(arrayList2);
    // BUG: Diagnostic contains:
    arrayList1.removeAll(arrayList2);
    // BUG: Diagnostic contains:
    arrayList1.retainAll(arrayList2);
  }