@@ -0,0 +1,2202 @@
+package com.owo.asynctask;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Apublic class SourcesReducer%3CParam%3E %7B%0A    public static interface Source%3CParam%3E %7B%0A        void run(Param param);%0A%0A        Object getTag();%0A%0A        Param getParam();%0A    %7D%0A%0A    private Map%3CObject, Source%3CParam%3E%3E mSources = new HashMap%3C%3E();%0A    private Callback%3CMap%3CObject, Source%3CParam%3E%3E%3E mCallback;%0A%0A    public SourcesReducer%3CParam%3E callback(%0A            Callback%3CMap%3CObject, Source%3CParam%3E%3E%3E callback) %7B%0A        mCallback = callback;%0A        return this;%0A    %7D%0A%0A    private class SourceImple implements Source%3CParam%3E %7B%0A        private final Object mTag;%0A        private Param mParam;%0A%0A        public SourceImple(Object tag) %7B%0A            mTag = tag;%0A        %7D%0A%0A        @Override%0A        public void run(Param param) %7B%0A            mParam = param;%0A            mCallback.run(mSources);%0A        %7D%0A%0A        @Override%0A        public Object getTag() %7B%0A            return mTag;%0A        %7D%0A%0A        @Override%0A        public Param getParam() %7B%0A            return mParam;%0A        %7D%0A    %7D%0A%0A    public Source%3CParam%3E makeSource(Object tag) %7B%0A        Source%3CParam%3E source = new SourceImple(tag);%0A        mSources.put(tag, source);%0A        return source;%0A    %7D%0A    %0A//    public class Main %7B%0A//%0A//        public static void main(String%5B%5D args) %7B%0A//            SourcesReducer%3CString%3E reducer = new SourcesReducer%3C%3E();%0A//            Source%3CString%3E s1 = reducer.makeSource(%22s1%22);%0A//            Source%3CString%3E s2 = reducer.makeSource(%22s2%22);%0A//            Source%3CString%3E s3 = reducer.makeSource(%22s3%22);%0A//            reducer.callback(new Callback%3CMap%3CObject, Source%3CString%3E%3E%3E() %7B%0A//                @Override%0A//                public void run(Map%3CObject, Source%3CString%3E%3E t) %7B%0A//                    if (%22abc%22.equals(t.get(%22s1%22).getParam())%0A//                            && %223f%22.equals(t.get(%22s2%22).getParam())%0A//                            && %224c%22.equals(t.get(%22s3%22).getParam())) %7B%0A//                        // condition match%0A//                        System.out.println(%22match%22);%0A//                    %7D%0A//                %7D%0A//            %7D);%0A//            s1.run(%22abc%22);%0A//            s2.run(%223f%22);%0A//            s3.run(%224c%22);%0A//        %7D%0A//    %7D%0A%7D%0A

add sourceReducer