// -------------------------------------------------------------- /* couch_manipulate.java May/06/2015 */ // -------------------------------------------------------------- import java.util.HashMap; import java.util.List; import net.arnx.jsonic.JSON; // -------------------------------------------------------------- public class couch_manipulate { // -------------------------------------------------------------- static HashMap > couch_to_dict_proc (String url_collection) { HashMap > dict_aa = new HashMap > (); String url_all_docs = url_collection + "/_all_docs?include_docs=true"; String str_json = get_uri.get_uri_proc (url_all_docs); HashMap data = (HashMap )JSON.decode (str_json); List >list_rows = (List >) data.get ("rows"); for (HashMap row: list_rows) { String key = row.get ("key").toString (); Object doc = row.get ("doc"); HashMap unit_aa = HashMap.class.cast (doc); dict_aa.put (key,unit_aa); } return dict_aa; } // -------------------------------------------------------------- } // --------------------------------------------------------------