IMAGE - The type of Image instance held by the dataset.public class FlickrImageDataset<IMAGE extends Image<?,IMAGE>> extends ReadableListDataset<IMAGE,InputStream>
| Modifier and Type | Class and Description |
|---|---|
static class |
FlickrImageDataset.Size
Possible sizes of image from flickr.
|
| Modifier and Type | Field and Description |
|---|---|
protected List<com.flickr4java.flickr.photos.Photo> |
photos |
protected FlickrImageDataset.Size |
targetSize |
readermodCount| Modifier | Constructor and Description |
|---|---|
protected |
FlickrImageDataset(InputStreamObjectReader<IMAGE> reader,
List<com.flickr4java.flickr.photos.Photo> photos) |
| Modifier and Type | Method and Description |
|---|---|
static <IMAGE extends Image<?,IMAGE>> |
create(InputStreamObjectReader<IMAGE> reader,
FlickrAPIToken token,
String searchTerms)
Create an image dataset by searching flickr with the given search terms.
|
static <IMAGE extends Image<?,IMAGE>> |
create(InputStreamObjectReader<IMAGE> reader,
FlickrAPIToken token,
String searchTerms,
int number)
Create an image dataset by searching flickr with the given search terms.
|
static <IMAGE extends Image<?,IMAGE>> |
create(InputStreamObjectReader<IMAGE> reader,
FlickrAPIToken token,
URL url)
Create an image dataset from the flickr gallery, photoset or collection
at the given url.
|
static <IMAGE extends Image<?,IMAGE>> |
create(InputStreamObjectReader<IMAGE> reader,
FlickrAPIToken token,
URL url,
int number)
Create an image dataset from the flickr gallery, photoset or collection
at the given url.
|
static <IMAGE extends Image<?,IMAGE>> |
createFromCollection(InputStreamObjectReader<IMAGE> reader,
FlickrAPIToken token,
String collectionsId,
String userId)
Create an image dataset from a flickr collection with the specified
parameters.
|
static <IMAGE extends Image<?,IMAGE>> |
createFromCollection(InputStreamObjectReader<IMAGE> reader,
FlickrAPIToken token,
String collectionId,
String userId,
int number)
Create an image dataset from a flickr collection with the specified
parameters.
|
static <IMAGE extends Image<?,IMAGE>> |
createFromGallery(InputStreamObjectReader<IMAGE> reader,
FlickrAPIToken token,
com.flickr4java.flickr.galleries.Gallery gallery)
Create an image dataset from a flickr gallery with the specified
parameters.
|
static <IMAGE extends Image<?,IMAGE>> |
createFromGallery(InputStreamObjectReader<IMAGE> reader,
FlickrAPIToken token,
com.flickr4java.flickr.galleries.Gallery gallery,
int number)
Create an image dataset from a flickr gallery with the specified
parameters.
|
static <IMAGE extends Image<?,IMAGE>> |
createFromGallery(InputStreamObjectReader<IMAGE> reader,
FlickrAPIToken token,
String galleryId)
Create an image dataset from a flickr gallery with the specified
parameters.
|
static <IMAGE extends Image<?,IMAGE>> |
createFromGallery(InputStreamObjectReader<IMAGE> reader,
FlickrAPIToken token,
String galleryId,
int number)
Create an image dataset from a flickr gallery with the specified
parameters.
|
static <IMAGE extends Image<?,IMAGE>> |
createFromPhotoset(InputStreamObjectReader<IMAGE> reader,
FlickrAPIToken token,
String setId)
Create an image dataset from a flickr photoset.
|
static <IMAGE extends Image<?,IMAGE>> |
createFromPhotoset(InputStreamObjectReader<IMAGE> reader,
FlickrAPIToken token,
String setId,
int number)
Create an image dataset from a flickr photoset.
|
static <IMAGE extends Image<?,IMAGE>> |
createFromSearch(InputStreamObjectReader<IMAGE> reader,
FlickrAPIToken token,
com.flickr4java.flickr.photos.SearchParameters params)
Create an image dataset from a flickr search with the specified
parameters.
|
static <IMAGE extends Image<?,IMAGE>> |
createFromSearch(InputStreamObjectReader<IMAGE> reader,
FlickrAPIToken token,
com.flickr4java.flickr.photos.SearchParameters params,
int number)
Create an image dataset from a flickr search with the specified
parameters.
|
String |
getID(int index)
Get an identifier for the instance at the given index.
|
FlickrImageDataset.Size |
getImageSize()
Get the size of the images that this dataset produces.
|
IMAGE |
getInstance(int index)
Returns the instance at the specified position in this dataset.
|
com.flickr4java.flickr.photos.Photo |
getPhoto(int index)
Get the a specific underlying flickr
Photo object corresponding
to a particular image instance. |
List<com.flickr4java.flickr.photos.Photo> |
getPhotos()
Get the underlying flickr
Photo objects. |
Iterator<IMAGE> |
iterator() |
int |
numInstances()
Returns the number of instances in this dataset.
|
void |
setImageSize(FlickrImageDataset.Size size)
Set the size of the images that this dataset produces.
|
String |
toString() |
get, getRandomInstance, indexOfID, size, toIdentifiableadd, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList, toArray, toArrayparallelStream, removeIf, streamprotected FlickrImageDataset.Size targetSize
protected FlickrImageDataset(InputStreamObjectReader<IMAGE> reader, List<com.flickr4java.flickr.photos.Photo> photos)
public void setImageSize(FlickrImageDataset.Size size)
size - the sizepublic FlickrImageDataset.Size getImageSize()
public List<com.flickr4java.flickr.photos.Photo> getPhotos()
Photo objects.Photos.public com.flickr4java.flickr.photos.Photo getPhoto(int index)
Photo object corresponding
to a particular image instance.index - the index of the instancePhoto corresponding to the given instance
index.public IMAGE getInstance(int index)
ListDatasetindex - index of the instance to returnpublic int numInstances()
Datasetpublic String getID(int index)
ReadableListDatasetString, but sub-classes
should override to to something more sensible if possible.getID in class ReadableListDataset<IMAGE extends Image<?,IMAGE>,InputStream>index - the indexpublic String toString()
toString in class AbstractCollection<IMAGE extends Image<?,IMAGE>>public static <IMAGE extends Image<?,IMAGE>> FlickrImageDataset<IMAGE> create(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, URL url) throws Exception
reader - the reader with which to load the imagestoken - the flickr api authentication tokenurl - the url of the collection/gallery/photo-setFlickrImageDataset created from the given urlException - if an error occurspublic static <IMAGE extends Image<?,IMAGE>> FlickrImageDataset<IMAGE> create(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, String searchTerms) throws Exception
reader - the reader with which to load the imagestoken - the flickr api authentication tokensearchTerms - the search terms; space separated. Prepending a term with a
"-" means that the term should not appear.FlickrImageDataset created from the given urlException - if an error occurspublic static <IMAGE extends Image<?,IMAGE>> FlickrImageDataset<IMAGE> create(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, String searchTerms, int number) throws Exception
reader - the reader with which to load the imagestoken - the flickr api authentication tokensearchTerms - the search terms; space separated. Prepending a term with a
"-" means that the term should not appear.number - the maximum number of images to add to the dataset. Setting to
0 or less will attempt to use all the images.FlickrImageDataset created from the given urlException - if an error occurspublic static <IMAGE extends Image<?,IMAGE>> FlickrImageDataset<IMAGE> create(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, URL url, int number) throws Exception
reader - the reader with which to load the imagestoken - the flickr api authentication tokenurl - the url of the collection/gallery/photo-setnumber - the maximum number of images to add to the dataset. Setting to
0 or less will attempt to use all the images.FlickrImageDataset created from the given urlException - if an error occurspublic static <IMAGE extends Image<?,IMAGE>> FlickrImageDataset<IMAGE> createFromGallery(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, com.flickr4java.flickr.galleries.Gallery gallery) throws Exception
reader - the reader with which to load the imagestoken - the flickr api authentication tokengallery - the gallery.FlickrImageDataset created from the gallery described
by the given parametersException - if an error occurspublic static <IMAGE extends Image<?,IMAGE>> FlickrImageDataset<IMAGE> createFromGallery(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, com.flickr4java.flickr.galleries.Gallery gallery, int number) throws Exception
reader - the reader with which to load the imagestoken - the flickr api authentication tokengallery - the gallery.number - the maximum number of images to add to the dataset. Setting to
0 or less will attempt to use all the images.FlickrImageDataset created from the gallery described
by the given parametersException - if an error occurspublic static <IMAGE extends Image<?,IMAGE>> FlickrImageDataset<IMAGE> createFromGallery(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, String galleryId) throws Exception
reader - the reader with which to load the imagestoken - the flickr api authentication tokengalleryId - the Flickr gallery ID.FlickrImageDataset created from the gallery described
by the given parametersException - if an error occurspublic static <IMAGE extends Image<?,IMAGE>> FlickrImageDataset<IMAGE> createFromGallery(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, String galleryId, int number) throws Exception
reader - the reader with which to load the imagestoken - the flickr api authentication tokengalleryId - the Flickr gallery IDnumber - the maximum number of images to add to the dataset. Setting to
0 or less will attempt to use all the images.FlickrImageDataset created from the gallery described
by the given parametersException - if an error occurspublic static <IMAGE extends Image<?,IMAGE>> FlickrImageDataset<IMAGE> createFromPhotoset(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, String setId) throws Exception
reader - the reader with which to load the imagestoken - the flickr api authentication tokensetId - the photoset identifierFlickrImageDataset created from the gallery described
by the given parametersException - if an error occurspublic static <IMAGE extends Image<?,IMAGE>> FlickrImageDataset<IMAGE> createFromPhotoset(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, String setId, int number) throws Exception
reader - the reader with which to load the imagestoken - the flickr api authentication tokensetId - the photoset identifiernumber - the maximum number of images to add to the dataset. Setting to
0 or less will attempt to use all the images.FlickrImageDataset created from the gallery described
by the given parametersException - if an error occurspublic static <IMAGE extends Image<?,IMAGE>> FlickrImageDataset<IMAGE> createFromCollection(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, String collectionsId, String userId) throws Exception
reader - the reader with which to load the imagestoken - the flickr api authentication tokencollectionsId - the collections IDuserId - the user IDFlickrImageDataset created from the gallery described
by the given parametersException - if an error occurspublic static <IMAGE extends Image<?,IMAGE>> FlickrImageDataset<IMAGE> createFromCollection(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, String collectionId, String userId, int number) throws Exception
reader - the reader with which to load the imagestoken - the flickr api authentication tokencollectionId - the collection iduserId - the user idnumber - the maximum number of images to add to the dataset. Setting to
0 or less will attempt to use all the images.FlickrImageDataset created from the gallery described
by the given parametersException - if an error occurspublic static <IMAGE extends Image<?,IMAGE>> FlickrImageDataset<IMAGE> createFromSearch(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, com.flickr4java.flickr.photos.SearchParameters params) throws Exception
reader - the reader with which to load the imagestoken - the flickr api authentication tokenparams - the parameters describing the gallery and any additional
constraints.FlickrImageDataset created from the gallery described
by the given parametersException - if an error occurspublic static <IMAGE extends Image<?,IMAGE>> FlickrImageDataset<IMAGE> createFromSearch(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, com.flickr4java.flickr.photos.SearchParameters params, int number) throws Exception
reader - the reader with which to load the imagestoken - the flickr api authentication tokenparams - the parameters describing the gallery and any additional
constraints.number - the maximum number of images to add to the dataset. Setting to
0 or less will attempt to use all the images.FlickrImageDataset created from the gallery described
by the given parametersException - if an error occurs