public static <K> UnifiedSet<K> newSetWith(K... elements) { return UnifiedSet.<K>newSet(elements.length).with(elements); }
public static <K> UnifiedSet<K> newSetWith(K... elements) { return UnifiedSet.<K>newSet(elements.length).with(elements); }
@Override public MutableSet<T> with(T element) { return this.contains(element) ? this : UnifiedSet.newSet(this).with(element); }
@Override public MutableSet<T> with(T element) { return this.contains(element) ? this : UnifiedSet.newSet(this).with(element); }
@Override public <V> MutableSet<V> collect(BooleanToObjectFunction<? extends V> function) { UnifiedSet<V> target = UnifiedSet.newSet(this.size()); switch (this.state) { case 0: return target; case 1: return target.with(function.valueOf(false)); case 2: return target.with(function.valueOf(true)); case 3: target.add(function.valueOf(false)); target.add(function.valueOf(true)); return target; default: throw new AssertionError("Invalid state"); } }
@Override public <V> MutableSet<V> collect(BooleanToObjectFunction<? extends V> function) { UnifiedSet<V> target = UnifiedSet.newSet(this.size()); switch (this.state) { case 0: return target; case 1: return target.with(function.valueOf(false)); case 2: return target.with(function.valueOf(true)); case 3: target.add(function.valueOf(false)); target.add(function.valueOf(true)); return target; default: throw new AssertionError("Invalid state"); } }
public static <K> UnifiedSet<K> newSetWith(K... elements) { return UnifiedSet.<K>newSet(elements.length).with(elements); }
@Override public MutableSet<T> with(T element) { return this.contains(element) ? this : UnifiedSet.newSet(this).with(element); }
@Override public <V> MutableSet<V> collect(BooleanToObjectFunction<? extends V> function) { UnifiedSet<V> target = UnifiedSet.newSet(this.size()); switch (this.state) { case 0: return target; case 1: return target.with(function.valueOf(false)); case 2: return target.with(function.valueOf(true)); case 3: target.add(function.valueOf(false)); target.add(function.valueOf(true)); return target; default: throw new AssertionError("Invalid state"); } }