| 23 | abstract IPersistentMap doPersistent(); |
| 24 | |
| 25 | public ITransientMap conj(Object o) { |
| 26 | ensureEditable(); |
| 27 | if(o instanceof Map.Entry) |
| 28 | { |
| 29 | Map.Entry e = (Map.Entry) o; |
| 30 | |
| 31 | return assoc(e.getKey(), e.getValue()); |
| 32 | } |
| 33 | else if(o instanceof IPersistentVector) |
| 34 | { |
| 35 | IPersistentVector v = (IPersistentVector) o; |
| 36 | if(v.count() != 2) |
| 37 | throw new IllegalArgumentException("Vector arg to map conj must be a pair"); |
| 38 | return assoc(v.nth(0), v.nth(1)); |
| 39 | } |
| 40 | |
| 41 | ITransientMap ret = this; |
| 42 | for(ISeq es = RT.seq(o); es != null; es = es.next()) |
| 43 | { |
| 44 | Map.Entry e = (Map.Entry) es.first(); |
| 45 | ret = ret.assoc(e.getKey(), e.getValue()); |
| 46 | } |
| 47 | return ret; |
| 48 | } |
| 49 | |
| 50 | public final Object invoke(Object arg1) { |
| 51 | return valAt(arg1); |