@Override public boolean retainAll(Collection c) { if (c instanceof StructSet) { return retainAll((StructSet) c); } return super.retainAll(c); }
notInitializedInConstructors.retainAll(data.readFields); notInitializedInConstructors.retainAll(data.writtenNonNullFields); notInitializedInConstructors.retainAll(data.assumedNonNull.keySet()); notInitializedInConstructors.removeAll(data.writtenInConstructorFields); notInitializedInConstructors.removeAll(data.writtenInInitializationFields); readOnlyFields.removeAll(data.writtenFields); readOnlyFields.retainAll(data.readFields); nullOnlyFields.retainAll(data.readFields);
/** * Given a list of type Layer, return all EPSG codes that is supported by all of the layers. * This is an intersection of each layer's SRS set. * * @param layers A List of type Layer * @return a Set of type String, containin EPSG codes, or empty if none found */ public static Set findCommonEPSGs(List layers) { TreeSet set = new TreeSet(); Layer first = (Layer) layers.get(0); set.addAll(first.getSrs()); for (int i = 1; i < layers.size(); i++) { Layer layer = (Layer) layers.get(i); set.retainAll(layer.getSrs()); } return set; }
set.retainAll(set2); return set;
@Override public boolean retainAll(Collection<?> c) { return container.retainAll(c); }
private Set<Integer> removeNonExistentCycles(final int[] cycles) { final TreeSet<Integer> inputCyclesSet = new TreeSet<Integer>(); for (final Integer inputCycle : cycles) { inputCyclesSet.add(inputCycle); } inputCyclesSet.retainAll(detectedCycles); return inputCyclesSet; }
private Set<Integer> removeNonExistentCycles(final int[] cycles) { final TreeSet<Integer> inputCyclesSet = new TreeSet<Integer>(); for (final Integer inputCycle : cycles) { inputCyclesSet.add(inputCycle); } inputCyclesSet.retainAll(detectedCycles); return inputCyclesSet; }
@Override public boolean retainAll(Collection c) { if (c instanceof StructSet) { return retainAll((StructSet) c); } return super.retainAll(c); }
@Override public boolean retainAll(Collection c) { if (c instanceof StructSet) { return retainAll((StructSet) c); } return super.retainAll(c); }
private int[] removeNonExistentCycles(final int[] cycles) { final TreeSet<Integer> detectedCyclesSet = new TreeSet<Integer>(); for(final Integer cycle : detectedCycles) { detectedCyclesSet.add(cycle); } final TreeSet<Integer> inputCyclesSet = new TreeSet<Integer>(); for(final Integer inputCycle : cycles) { inputCyclesSet.add(inputCycle); } //This also sorts outputCycles final int[] outputCycles; inputCyclesSet.retainAll(detectedCyclesSet); outputCycles = new int[inputCyclesSet.size()]; int i = 0; for(final Integer element : inputCyclesSet) { outputCycles[i++] = element; } return outputCycles; }
/** * Given a list of type Layer, return all EPSG codes that is supported * by all of the layers. This is an intersection of each layer's SRS set. * * @param layers A List of type Layer * @return a Set of type String, containin EPSG codes, or empty if none found */ public static Set findCommonEPSGs(List layers) { TreeSet set = new TreeSet(); Layer first = (Layer) layers.get(0); set.addAll(first.getSrs()); for (int i = 1; i < layers.size(); i++ ) { Layer layer = (Layer) layers.get(i); set.retainAll(layer.getSrs()); } return set; }
/** * Given a list of type Layer, return all EPSG codes that is supported by all of the layers. * This is an intersection of each layer's SRS set. * * @param layers A List of type Layer * @return a Set of type String, containin EPSG codes, or empty if none found */ public static Set findCommonEPSGs(List layers) { TreeSet set = new TreeSet(); Layer first = (Layer) layers.get(0); set.addAll(first.getSrs()); for (int i = 1; i < layers.size(); i++) { Layer layer = (Layer) layers.get(i); set.retainAll(layer.getSrs()); } return set; }
@Override public void setResult(CKNumber result) { /* * LCOM = |P| - |Q| if |P| - |Q| > 0 * where * P = set of all empty set intersections * Q = set of all nonempty set intersections */ // extracted from https://github.com/dspinellis/ckjm int lcom = 0; for (int i = 0; i < methods.size(); i++) for (int j = i + 1; j < methods.size(); j++) { TreeSet<?> intersection = (TreeSet<?>)methods.get(i).clone(); intersection.retainAll(methods.get(j)); if (intersection.size() == 0) lcom++; else lcom--; } result.setLcom(lcom > 0 ? lcom : 0); }
/** * Computes (this & that) in GF(2^k) */ public Polynomial and(Polynomial that) { TreeSet<BigInteger> dgrs = this.createDegreesCollectionCopy(); dgrs.retainAll(that.degrees); return new Polynomial(dgrs); }
/** * Retains only the elements in this set that are contained in the * specified set. In other words, removes from this set all of * its elements that are not contained in the specified set. This * operation effectively modifies this set so that its value is * the <i>intersection</i> of the two sets. * * @param c set that defines which elements this set will retain. * @stable ICU 2.0 */ public UnicodeSet retainAll(UnicodeSet c) { checkFrozen(); retain(c.list, c.len, 0); strings.retainAll(c.strings); return this; }
@Override public boolean retainAll(Collection paramCollection) { if (_directAccess) { return super.retainAll(paramCollection); } if (isDelayLoad()) { load(); } return ProxyCollections.retainAll(this, paramCollection); }
@Override public boolean retainAll(Collection paramCollection) { if (_directAccess) { return super.retainAll(paramCollection); } if (isDelayLoad()) { load(); } return ProxyCollections.retainAll(this, paramCollection); }
@Override public boolean retainAll(Collection paramCollection) { if (_directAccess) { return super.retainAll(paramCollection); } if (isDelayLoad()) { load(); } return ProxyCollections.retainAll(this, paramCollection); }
@Override public boolean retainAll(Collection paramCollection) { if (_directAccess) { return super.retainAll(paramCollection); } if (isDelayLoad()) { load(); } return ProxyCollections.retainAll(this, paramCollection); }
final AccumulatedIcons iconSet2 = new AccumulatedIcons(Collections.EMPTY_SET); iconSet2.addAccumulatedIconsToTreeSet(child); iconSet.childIcons.retainAll(iconSet2.childIcons); if(iconSet.ownIcons.isEmpty() && iconSet.childIcons.isEmpty()) break;