| 16 | import java.util.Comparator; |
| 17 | |
| 18 | public abstract class AFunction extends AFn implements IObj, Comparator, Fn, Serializable { |
| 19 | |
| 20 | private static final long serialVersionUID = 4469383498184457675L; |
| 21 | |
| 22 | public volatile MethodImplCache __methodImplCache; |
| 23 | |
| 24 | public IPersistentMap meta(){ |
| 25 | return null; |
| 26 | } |
| 27 | |
| 28 | public IObj withMeta(final IPersistentMap meta){ |
| 29 | if(meta == null) |
| 30 | return this; |
| 31 | return new RestFn(){ |
| 32 | protected Object doInvoke(Object args) { |
| 33 | return AFunction.this.applyTo((ISeq) args); |
| 34 | } |
| 35 | |
| 36 | public IPersistentMap meta(){ |
| 37 | return meta; |
| 38 | } |
| 39 | |
| 40 | public IObj withMeta(IPersistentMap newMeta){ |
| 41 | if(meta == newMeta) |
| 42 | return this; |
| 43 | return AFunction.this.withMeta(newMeta); |
| 44 | } |
| 45 | |
| 46 | public int getRequiredArity(){ |
| 47 | return 0; |
| 48 | } |
| 49 | }; |
| 50 | } |
| 51 | |
| 52 | public int compare(Object o1, Object o2){ |
| 53 | Object o = invoke(o1, o2); |
| 54 | |
| 55 | if(o instanceof Boolean) |
| 56 | { |
| 57 | if(RT.booleanCast(o)) |
| 58 | return -1; |
| 59 | return RT.booleanCast(invoke(o2,o1))? 1 : 0; |
| 60 | } |
| 61 | |
| 62 | Number n = (Number) o; |
| 63 | return n.intValue(); |
| 64 | } |
| 65 | } |
nothing calls this directly
no outgoing calls
no test coverage detected