// Path: src/main/java/ch/picard/ppimapbuilder/data/interaction/client/web/miql/MiQLParameterBuilder.java
// public class MiQLParameterBuilder extends AbstractMiQLQueryElement {
// 
// 	public MiQLParameterBuilder(AbstractMiQLQueryElement value) {
// 		super(value);
// 	}
// 	
// 	public MiQLParameterBuilder(String value) {
// 		super(value);
// 	}
// 	
// 	public MiQLParameterBuilder(String name, String value) {
// 		this(name, (Object)value);
// 	}
// 	
// 	public MiQLParameterBuilder(String name, AbstractMiQLQueryElement value) {
// 		this(name, (Object)value);
// 	}
// 	
// 	public MiQLParameterBuilder(String name, Object value) {
// 		super(name+":");
// 		
// 		if(value instanceof AbstractMiQLQueryElement) add((AbstractMiQLQueryElement) value);
// 		else add(value.toString());
// 	}	
// }


import java.util.List;
import java.util.Set;
import ch.picard.ppimapbuilder.data.interaction.client.web.miql.MiQLExpressionBuilder;
import ch.picard.ppimapbuilder.data.interaction.client.web.miql.MiQLParameterBuilder;
import com.google.common.collect.Lists;
import org.hupo.psi.mi.psicquic.wsclient.PsicquicSimpleClient;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collection;
	 */
	public PsicquicRequestBuilder addQuery(final String query) {
		for (PsicquicSimpleClient client : clients) {
			try {
				long count = client.countByQuery(query);
				estimatedInteractionsCount += count;
				final int numberPages = (int) Math.ceil((double) count / (double) maxResultsPerPages);

				for (int page = 0; page < numberPages; page++) {
					final int firstResult = page * maxResultsPerPages;
					requests.add(new PsicquicRequest(client, query, firstResult, maxResultsPerPages));
				}
			} catch (IOException e) {
				requests.add(new PsicquicRequest(client, query, 0, Integer.MAX_VALUE));
			}
		}
		return this;
	}

	public PsicquicRequestBuilder addQueries(List<String> queries) {
		for (String query : queries) {
			addQuery(query);
		}
		return this;
	}

	public PsicquicRequestBuilder addGetByTaxon(final Integer taxonId) {
		MiQLExpressionBuilder query = new MiQLExpressionBuilder();

		query.setRoot(true);
// Path: src/main/java/ch/picard/ppimapbuilder/data/interaction/client/web/miql/MiQLParameterBuilder.java
// public class MiQLParameterBuilder extends AbstractMiQLQueryElement {
// 
// 	public MiQLParameterBuilder(AbstractMiQLQueryElement value) {
// 		super(value);
// 	}
// 	
// 	public MiQLParameterBuilder(String value) {
// 		super(value);
// 	}
// 	
// 	public MiQLParameterBuilder(String name, String value) {
// 		this(name, (Object)value);
// 	}
// 	
// 	public MiQLParameterBuilder(String name, AbstractMiQLQueryElement value) {
// 		this(name, (Object)value);
// 	}
// 	
// 	public MiQLParameterBuilder(String name, Object value) {
// 		super(name+":");
// 		
// 		if(value instanceof AbstractMiQLQueryElement) add((AbstractMiQLQueryElement) value);
// 		else add(value.toString());
// 	}	
// }


// Path: src/main/java/ch/picard/ppimapbuilder/data/interaction/client/web/PsicquicRequestBuilder.java
import java.util.List;
import java.util.Set;
import ch.picard.ppimapbuilder.data.interaction.client.web.miql.MiQLExpressionBuilder;
import ch.picard.ppimapbuilder.data.interaction.client.web.miql.MiQLParameterBuilder;
import com.google.common.collect.Lists;
import org.hupo.psi.mi.psicquic.wsclient.PsicquicSimpleClient;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collection;

	 */
	public PsicquicRequestBuilder addQuery(final String query) {
		for (PsicquicSimpleClient client : clients) {
			try {
				long count = client.countByQuery(query);
				estimatedInteractionsCount += count;
				final int numberPages = (int) Math.ceil((double) count / (double) maxResultsPerPages);

				for (int page = 0; page < numberPages; page++) {
					final int firstResult = page * maxResultsPerPages;
					requests.add(new PsicquicRequest(client, query, firstResult, maxResultsPerPages));
				}
			} catch (IOException e) {
				requests.add(new PsicquicRequest(client, query, 0, Integer.MAX_VALUE));
			}
		}
		return this;
	}

	public PsicquicRequestBuilder addQueries(List<String> queries) {
		for (String query : queries) {
			addQuery(query);
		}
		return this;
	}

	public PsicquicRequestBuilder addGetByTaxon(final Integer taxonId) {
		MiQLExpressionBuilder query = new MiQLExpressionBuilder();

		query.setRoot(true);
		query.add(new MiQLParameterBuilder("taxidA", taxonId));