| 13 | package clojure.lang; |
| 14 | |
| 15 | public abstract class ATransientSet extends AFn implements ITransientSet{ |
| 16 | volatile ITransientMap impl; |
| 17 | |
| 18 | ATransientSet(ITransientMap impl) { |
| 19 | this.impl = impl; |
| 20 | } |
| 21 | |
| 22 | public int count() { |
| 23 | return impl.count(); |
| 24 | } |
| 25 | |
| 26 | public ITransientSet conj(Object val) { |
| 27 | ITransientMap m = impl.assoc(val, val); |
| 28 | if (m != impl) this.impl = m; |
| 29 | return this; |
| 30 | } |
| 31 | |
| 32 | public boolean contains(Object key) { |
| 33 | return this != impl.valAt(key, this); |
| 34 | } |
| 35 | |
| 36 | public ITransientSet disjoin(Object key) { |
| 37 | ITransientMap m = impl.without(key); |
| 38 | if (m != impl) this.impl = m; |
| 39 | return this; |
| 40 | } |
| 41 | |
| 42 | public Object get(Object key) { |
| 43 | return impl.valAt(key); |
| 44 | } |
| 45 | |
| 46 | public Object invoke(Object key, Object notFound) { |
| 47 | return impl.valAt(key, notFound); |
| 48 | } |
| 49 | |
| 50 | public Object invoke(Object key) { |
| 51 | return impl.valAt(key); |
| 52 | } |
| 53 | |
| 54 | } |
nothing calls this directly
no outgoing calls
no test coverage detected