@Override public MutableSet<T> clone() { this.acquireReadLock(); try { return new MultiReaderUnifiedSet<>(this.delegate.clone()); } finally { this.unlockReadLock(); } }
@Override public MutableSet<T> with(T element) { this.add(element); return this; }
@Override public MutableSet<T> withAll(Iterable<? extends T> elements) { this.addAllIterable(elements); return this; }
@Override public MutableSet<T> tap(Procedure<? super T> procedure) { this.acquireReadLock(); try { this.forEach(procedure); return this; } finally { this.unlockReadLock(); } }
@Override public boolean equals(Object o) { this.acquireReadLock(); try { return this.delegate.equals(o); } finally { this.unlockReadLock(); } }
public void withReadLockAndDelegate(Procedure<MutableSet<T>> procedure) { this.acquireReadLock(); try { UntouchableMutableSet<T> untouchableSet = this.asReadUntouchable(); procedure.value(untouchableSet); untouchableSet.becomeUseless(); } finally { this.unlockReadLock(); } }
public void withWriteLockAndDelegate(Procedure<MutableSet<T>> procedure) { this.acquireWriteLock(); try { UntouchableMutableSet<T> untouchableSet = this.asWriteUntouchable(); procedure.value(untouchableSet); untouchableSet.becomeUseless(); } finally { this.unlockWriteLock(); } }
@Override public MutableSet<T> newEmpty() { return MultiReaderUnifiedSet.newSet(); }
public static <T> MultiReaderUnifiedSet<T> newSetWith(T... elements) { return new MultiReaderUnifiedSet<>(UnifiedSet.newSetWith(elements)); }
@Override public <T> MutableSet<T> with(T... items) { return MultiReaderUnifiedSet.newSetWith(items); }
@Override public int hashCode() { this.acquireReadLock(); try { return this.delegate.hashCode(); } finally { this.unlockReadLock(); } }
@Override public MutableSet<T> tap(Procedure<? super T> procedure) { this.acquireReadLock(); try { this.forEach(procedure); return this; } finally { this.unlockReadLock(); } }
public void withReadLockAndDelegate(Procedure<MutableSet<T>> procedure) { this.acquireReadLock(); try { UntouchableMutableSet<T> untouchableSet = this.asReadUntouchable(); procedure.value(untouchableSet); untouchableSet.becomeUseless(); } finally { this.unlockReadLock(); } }
public void withWriteLockAndDelegate(Procedure<MutableSet<T>> procedure) { this.acquireWriteLock(); try { UntouchableMutableSet<T> untouchableSet = this.asWriteUntouchable(); procedure.value(untouchableSet); untouchableSet.becomeUseless(); } finally { this.unlockWriteLock(); } }
@Override protected MutableSet<V> createCollection() { return MultiReaderUnifiedSet.newSet(); }
public static <T> MultiReaderUnifiedSet<T> newSet(Iterable<T> iterable) { return new MultiReaderUnifiedSet<>(UnifiedSet.newSet(iterable)); }
@Override public <T> MutableSet<T> with(T... items) { return MultiReaderUnifiedSet.newSetWith(items); }
@Override public int hashCode() { this.acquireReadLock(); try { return this.delegate.hashCode(); } finally { this.unlockReadLock(); } }
@Override public MutableSet<T> clone() { this.acquireReadLock(); try { return new MultiReaderUnifiedSet<>(this.delegate.clone()); } finally { this.unlockReadLock(); } }
@Override public MutableSet<T> tap(Procedure<? super T> procedure) { this.acquireReadLock(); try { this.forEach(procedure); return this; } finally { this.unlockReadLock(); } }