@Override public MutableSet<T> clone() { return this.getDelegate().clone(); }
@Override public MutableSet<T> clone() { return this.getDelegate().clone(); }
/** * @param user user to get known items for * @return set of known items for the user (immutable, but thread-safe) */ public Set<String> getKnownItems(String user) { MutableSet<String> knownItemsForUser = doGetKnownItems(user); if (knownItemsForUser == null) { return Collections.emptySet(); } synchronized (knownItemsForUser) { if (knownItemsForUser.isEmpty()) { return Collections.emptySet(); } // Must copy since the original object is synchronized return knownItemsForUser.clone().asUnmodifiable(); } }
@Override public MutableSet<T> clone() { synchronized (this.getLock()) { return SynchronizedMutableSet.of(this.getMutableSet().clone()); } }
@Override public MutableSet<T> clone() { synchronized (this.getLock()) { return SynchronizedMutableSet.of(this.getMutableSet().clone()); } }
@Override public MutableSet<T> clone() { this.acquireReadLock(); try { return new MultiReaderUnifiedSet<>(this.delegate.clone()); } finally { this.unlockReadLock(); } }
@Override public MutableSet<T> clone() { this.acquireReadLock(); try { return new MultiReaderUnifiedSet<>(this.delegate.clone()); } finally { this.unlockReadLock(); } }
private static <T> MutableSet<MutableSet<T>> powerSetWithSeed(Set<T> set, MutableSet<MutableSet<T>> seed) { return Iterate.injectInto(seed, set, (accumulator, element) -> SetIterables.union(accumulator, accumulator.collect(innerSet -> innerSet.clone().with(element)))); }
private static <T> MutableSet<MutableSet<T>> powerSetWithSeed(Set<T> set, MutableSet<MutableSet<T>> seed) { return Iterate.injectInto(seed, set, (accumulator, element) -> SetIterables.union(accumulator, accumulator.collect(innerSet -> innerSet.clone().with(element)))); }
@Override public MutableSet<T> clone() { return this.getDelegate().clone(); }
@Override public MutableSet<T> clone() { synchronized (this.getLock()) { return SynchronizedMutableSet.of(this.getMutableSet().clone()); } }
@Override public MutableSet<T> clone() { this.acquireReadLock(); try { return new MultiReaderUnifiedSet<>(this.delegate.clone()); } finally { this.unlockReadLock(); } }
private static <T> MutableSet<MutableSet<T>> powerSetWithSeed(Set<T> set, MutableSet<MutableSet<T>> seed) { return Iterate.injectInto(seed, set, (accumulator, element) -> SetIterables.union(accumulator, accumulator.collect(innerSet -> innerSet.clone().with(element)))); }