/** * Perform a search with the given query string. * * @param reader * the reader with which to load the images * @param token * the api authentication token * @param query * the query * @param number * the target number of results; the resultant dataset may * contain fewer images than specified. * @return a new {@link BingImageDataset} created from the query. */ public static <IMAGE extends Image<?, IMAGE>> BingImageDataset<IMAGE> create(InputStreamObjectReader<IMAGE> reader, BingAPIToken token, String query, int number) { final ImageDataSourceQuery aq = new ImageDataSourceQuery(); aq.setSubscriptionKey(token.accountKey); aq.setQuery(query); return new BingImageDataset<IMAGE>(reader, performQuery(aq, number), aq); }
/** * Perform a search with the given query string. * * @param reader * the reader with which to load the images * @param token * the api authentication token * @param query * the query * @param number * the target number of results; the resultant dataset may * contain fewer images than specified. * @return a new {@link BingImageDataset} created from the query. */ public static <IMAGE extends Image<?, IMAGE>> BingImageDataset<IMAGE> create(InputStreamObjectReader<IMAGE> reader, BingAPIToken token, String query, int number) { final ImageDataSourceQuery aq = new ImageDataSourceQuery(); aq.setSubscriptionKey(token.accountKey); aq.setQuery(query); return new BingImageDataset<IMAGE>(reader, performQuery(aq, number), aq); }