protected final void addDependencyClassToScanner(Class<? extends AppByteCodeScanner> scannerClass, String className) { Set<String> set = dependencyClasses.get(scannerClass); if (null == set) { set = C.newSet(); dependencyClasses.put(scannerClass, set); } set.add(className); }
protected final void addDependencyClassToScanner(Class<? extends AppByteCodeScanner> scannerClass, Collection<String> classNames) { Set<String> set = dependencyClasses.get(scannerClass); if (null == set) { set = C.newSet(); dependencyClasses.put(scannerClass, set); } set.addAll(classNames); }
protected final void addDependencyClass(String className) { Set<String> set = dependencyClasses.get(getClass()); if (null == set) { set = C.newSet(); dependencyClasses.put(getClass(), set); } set.add(className); }
protected final void addDependencyClass(String className) { Set<String> set = dependencyClasses.get(getClass()); if (null == set) { set = C.newSet(); dependencyClasses.put(getClass(), set); } set.add(className); }
private C.Set<String> modified(C.Set<String> retained, Map<String, Long> newTimestamps) { C.Set<String> modified = C.newSet(); for (String path : retained) { long ts0 = timestamps.get(path); long ts1 = newTimestamps.get(path); if (ts0 != ts1) { modified.add(path); } } return modified; }
@Override public C.Set<T> onlyIn(Collection<? extends T> col) { C.Set<T> set = C.newSet(col); if (col.contains(v)) { set.remove(v); } return set; }
private C.Set<String> modified(C.Set<String> retained, Map<String, Long> newTimestamps) { C.Set<String> modified = C.newSet(); for (String path : retained) { long ts0 = timestamps.get(path); long ts1 = newTimestamps.get(path); if (ts0 != ts1) { modified.add(path); } } return modified; }
@Override public C.Set<T> with(T element) { C.Set<T> copy = C.newSet(this); copy.add(element); return copy; }
@Override public C.Set<T> with(T element) { C.Set<T> copy = C.newSet(this); copy.add(element); return copy; }
@Override public List<MetricInfo> timers() { Set<MetricInfo> set = C.newSet(); for (Map.Entry<String, AtomicLong> entry : timers.entrySet()) { set.add(new MetricInfo(entry.getKey(), entry.getValue().get(), counters.get(entry.getKey()).get())); } return C.list(set); }
@Override public List<MetricInfo> timers() { Set<MetricInfo> set = C.newSet(); for (Map.Entry<String, AtomicLong> entry : timers.entrySet()) { set.add(new MetricInfo(entry.getKey(), entry.getValue().get(), counters.get(entry.getKey()).get())); } return C.list(set); }
@Override public Set<java.util.Map.Entry<K, V>> entrySet() { Set<java.util.Map.Entry<K, V>> set = C.newSet(); for (K k : _m.keySet()) { V v = _m.get(k); set.add(Entry.valueOf(k, v)); } return set; }
@Override public C.Set<T> withIn(Collection<? extends T> col) { C.Set<T> others = C.newSet(col); others.retainAll(this); if (isImmutable()) { return ImmutableSet.of(others); } return others; }
@Override public C.Set<T> onlyIn(Collection<? extends T> col) { C.Set<T> others = C.newSet(col); others.removeAll(this); if (isImmutable()) { return ImmutableSet.of(others); } return others; }
@Override public C.Set<T> without(Collection<? super T> col) { C.Set<T> copy = C.newSet(this); copy.removeAll(col); if (isImmutable()) { return ImmutableSet.of(copy); } return copy; }
@Override public C.Set<T> with(Collection<? extends T> col) { C.Set<T> copy = C.newSet(this); copy.addAll(col); if (isImmutable()) { return ImmutableSet.of(copy); } return copy; }
public static <T> Set<T> interceptionOf(Collection<? extends T> col1, Collection<? extends T> col2, Collection<? extends T> col3, Collection<? extends T>... otherCols) { Set<T> interception = C.newSet(col1); interception.retainAll(col2); interception.retainAll(col3); for (Collection<? extends T> col : otherCols) { interception.retainAll(col); } return C.set(interception); }
public static <T> Set<T> interceptionOf(Collection<? extends T> col1, Collection<? extends T> col2, Collection<? extends T> col3, Collection<? extends T>... otherCols) { Set<T> interception = C.newSet(col1); interception.retainAll(col2); interception.retainAll(col3); for (Collection<? extends T> col : otherCols) { interception.retainAll(col); } return C.set(interception); }
public static <T> Set<T> unionOf(Collection<? extends T> col1, Collection<? extends T> col2, Collection<? extends T> col3, Collection<? extends T> ... otherCols) { Set<T> union = C.newSet(col1); union.addAll(col2); union.addAll(col3); for (Collection<? extends T> col : otherCols) { union.addAll(col); } return C.set(union); }