@Override public String getID() { return query.getQuery(); }
/** * 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); }
/** * Create an image dataset from the flickr gallery, photoset or collection * at the given url. * * @param reader * the reader with which to load the images * @param token * the flickr api authentication token * @param url * the url of the collection/gallery/photo-set * @return a {@link FlickrImageDataset} created from the given url * @throws Exception * if an error occurs */ public static <IMAGE extends Image<?, IMAGE>> FlickrImageDataset<IMAGE> create(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, URL url) throws Exception { return create(reader, token, url, 0); }
/** * Perform a search with the given query. The given api token will be used * to set the appid in the query object. * * @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, ImageDataSourceQuery query, int number) { query.setSubscriptionKey(token.accountKey); return new BingImageDataset<IMAGE>(reader, performQuery(query, number), query); }
/** * Perform a search with the given query. The appid must have been set * externally. * * * @param reader * the reader with which to load the images * @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, ImageDataSourceQuery query, int number) { return new BingImageDataset<IMAGE>(reader, performQuery(query, number), query); }
/** * Create an image dataset from a flickr photoset. * * @param reader * the reader with which to load the images * @param token * the flickr api authentication token * @param setId * the photoset identifier * @return a {@link FlickrImageDataset} created from the gallery described * by the given parameters * @throws Exception * if an error occurs */ public static <IMAGE extends Image<?, IMAGE>> FlickrImageDataset<IMAGE> createFromPhotoset( InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, String setId) throws Exception { return createFromPhotoset(reader, token, setId, 0); }
@Override public IMAGE getInstance(int index) { return read(photos.get(index)); }
/** * Create an image dataset from a flickr gallery with the specified * parameters. * * @param reader * the reader with which to load the images * @param token * the flickr api authentication token * @param galleryId * the Flickr gallery ID. * @return a {@link FlickrImageDataset} created from the gallery described * by the given parameters * @throws Exception * if an error occurs */ public static <IMAGE extends Image<?, IMAGE>> FlickrImageDataset<IMAGE> createFromGallery( InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, String galleryId) throws Exception { return createFromGallery(reader, token, galleryId, 0); }
/** * Create an image dataset from a flickr search with the specified * parameters. * * @param reader * the reader with which to load the images * @param token * the flickr api authentication token * @param params * the parameters describing the gallery and any additional * constraints. * @return a {@link FlickrImageDataset} created from the gallery described * by the given parameters * @throws Exception * if an error occurs */ public static <IMAGE extends Image<?, IMAGE>> FlickrImageDataset<IMAGE> createFromSearch( InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, com.flickr4java.flickr.photos.SearchParameters params) throws Exception { return createFromSearch(reader, token, params, 0); }
/** * 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); }
/** * Create an image dataset by searching flickr with the given search terms. * * @param reader * the reader with which to load the images * @param token * the flickr api authentication token * @param searchTerms * the search terms; space separated. Prepending a term with a * "-" means that the term should not appear. * @return a {@link FlickrImageDataset} created from the given url * @throws Exception * if an error occurs */ public static <IMAGE extends Image<?, IMAGE>> FlickrImageDataset<IMAGE> create(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, String searchTerms) throws Exception { return create(reader, token, searchTerms, 0); }
/** * Perform a search with the given query. The given api token will be used * to set the appid in the query object. * * @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, ImageDataSourceQuery query, int number) { query.setSubscriptionKey(token.accountKey); return new BingImageDataset<IMAGE>(reader, performQuery(query, number), query); }
/** * Perform a search with the given query. The appid must have been set * externally. * * * @param reader * the reader with which to load the images * @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, ImageDataSourceQuery query, int number) { return new BingImageDataset<IMAGE>(reader, performQuery(query, number), query); }
@Override public String getID() { return query.getQuery(); }
/** * Create an image dataset from a flickr photoset. * * @param reader * the reader with which to load the images * @param token * the flickr api authentication token * @param setId * the photoset identifier * @return a {@link FlickrImageDataset} created from the gallery described * by the given parameters * @throws Exception * if an error occurs */ public static <IMAGE extends Image<?, IMAGE>> FlickrImageDataset<IMAGE> createFromPhotoset( InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, String setId) throws Exception { return createFromPhotoset(reader, token, setId, 0); }
@Override public IMAGE getInstance(int index) { return read(photos.get(index)); }
/** * Create an image dataset by searching flickr with the given search terms. * * @param reader * the reader with which to load the images * @param token * the flickr api authentication token * @param searchTerms * the search terms; space separated. Prepending a term with a * "-" means that the term should not appear. * @return a {@link FlickrImageDataset} created from the given url * @throws Exception * if an error occurs */ public static <IMAGE extends Image<?, IMAGE>> FlickrImageDataset<IMAGE> create(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, String searchTerms) throws Exception { return create(reader, token, searchTerms, 0); }
/** * Create an image dataset from the flickr gallery, photoset or collection * at the given url. * * @param reader * the reader with which to load the images * @param token * the flickr api authentication token * @param url * the url of the collection/gallery/photo-set * @return a {@link FlickrImageDataset} created from the given url * @throws Exception * if an error occurs */ public static <IMAGE extends Image<?, IMAGE>> FlickrImageDataset<IMAGE> create(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, URL url) throws Exception { return create(reader, token, url, 0); }