/** * @deprecated in 6.0. Use {@link OrderedIterable#zipWithIndex()} instead. */ @Override @Deprecated public MutableSet<Pair<T, Integer>> zipWithIndex() { return this.getDelegate().zipWithIndex(); }
public void withWriteLockAndDelegate(Procedure<MutableSet<T>> procedure) { this.acquireWriteLock(); try { UntouchableMutableSet<T> untouchableSet = this.asWriteUntouchable(); procedure.value(untouchableSet); untouchableSet.becomeUseless(); } finally { this.unlockWriteLock(); } }
UntouchableMutableSet<T> asWriteUntouchable() { return new UntouchableMutableSet<>(this.delegate); }
UntouchableMutableSet<T> asReadUntouchable() { return new UntouchableMutableSet<>(this.delegate.asUnmodifiable()); }
public void withReadLockAndDelegate(Procedure<MutableSet<T>> procedure) { this.acquireReadLock(); try { UntouchableMutableSet<T> untouchableSet = this.asReadUntouchable(); procedure.value(untouchableSet); untouchableSet.becomeUseless(); } finally { this.unlockReadLock(); } }
@Override public MutableSet<T> without(T element) { this.remove(element); return this; }
@Override public MutableSet<T> withAll(Iterable<? extends T> elements) { this.addAllIterable(elements); return this; }
@Override public MutableSet<T> withoutAll(Iterable<? extends T> elements) { this.removeAllIterable(elements); return this; }
/** * This must be implemented this way to guarantee a reference to the delegate doesn't escape. */ @Override public MutableSet<T> with(T element) { this.add(element); return this; }
@Override public MutableSet<T> tap(Procedure<? super T> procedure) { this.forEach(procedure); return this; }
public void withWriteLockAndDelegate(Procedure<MutableSet<T>> procedure) { this.acquireWriteLock(); try { UntouchableMutableSet<T> untouchableSet = this.asWriteUntouchable(); procedure.value(untouchableSet); untouchableSet.becomeUseless(); } finally { this.unlockWriteLock(); } }
UntouchableMutableSet<T> asReadUntouchable() { return new UntouchableMutableSet<>(this.delegate.asUnmodifiable()); }
public void withWriteLockAndDelegate(Procedure<MutableSet<T>> procedure) { this.acquireWriteLock(); try { UntouchableMutableSet<T> untouchableSet = this.asWriteUntouchable(); procedure.value(untouchableSet); untouchableSet.becomeUseless(); } finally { this.unlockWriteLock(); } }
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 withReadLockAndDelegate(Procedure<MutableSet<T>> procedure) { this.acquireReadLock(); try { UntouchableMutableSet<T> untouchableSet = this.asReadUntouchable(); procedure.value(untouchableSet); untouchableSet.becomeUseless(); } finally { this.unlockReadLock(); } }
UntouchableMutableSet<T> asReadUntouchable() { return new UntouchableMutableSet<>(this.delegate.asUnmodifiable()); }
@Override public <R extends MutableIntCollection> R collectInt(IntFunction<? super T> intFunction, R target) { return this.getDelegate().collectInt(intFunction, target); }
@Override public <R extends MutableFloatCollection> R collectFloat(FloatFunction<? super T> floatFunction, R target) { return this.getDelegate().collectFloat(floatFunction, target); }
@Override public MutableSet<T> without(T element) { this.remove(element); return this; }
/** * This must be implemented this way to guarantee a reference to the delegate doesn't escape. */ @Override public MutableSet<T> with(T element) { this.add(element); return this; }