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.aetrion.flickr.photos.Photo> |
photos |
protected FlickrImageDataset.Size |
targetSize |
reader
modCount
Modifier | Constructor and Description |
---|---|
protected |
FlickrImageDataset(InputStreamObjectReader<IMAGE> reader,
List<com.aetrion.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,
com.aetrion.flickr.collections.CollectionsSearchParameters params)
Create an image dataset from a flickr collection with the specified
parameters.
|
static <IMAGE extends Image<?,IMAGE>> |
createFromCollection(InputStreamObjectReader<IMAGE> reader,
FlickrAPIToken token,
com.aetrion.flickr.collections.CollectionsSearchParameters params,
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.aetrion.flickr.galleries.SearchParameters params)
Create an image dataset from a flickr gallery with the specified
parameters.
|
static <IMAGE extends Image<?,IMAGE>> |
createFromGallery(InputStreamObjectReader<IMAGE> reader,
FlickrAPIToken token,
com.aetrion.flickr.galleries.SearchParameters params,
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.aetrion.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.aetrion.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.aetrion.flickr.photos.Photo |
getPhoto(int index)
Get the a specific underlying flickr
Photo object corresponding
to a particular image instance. |
List<com.aetrion.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, toIdentifiable
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
protected FlickrImageDataset.Size targetSize
protected FlickrImageDataset(InputStreamObjectReader<IMAGE> reader, List<com.aetrion.flickr.photos.Photo> photos)
public void setImageSize(FlickrImageDataset.Size size)
size
- the sizepublic FlickrImageDataset.Size getImageSize()
public List<com.aetrion.flickr.photos.Photo> getPhotos()
Photo
objects.Photo
s.public com.aetrion.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)
ListDataset
index
- index of the instance to returnpublic int numInstances()
Dataset
public String getID(int index)
ReadableListDataset
String
, 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.aetrion.flickr.galleries.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> createFromGallery(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, com.aetrion.flickr.galleries.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 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, com.aetrion.flickr.collections.CollectionsSearchParameters 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> createFromCollection(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, com.aetrion.flickr.collections.CollectionsSearchParameters 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 occurspublic static <IMAGE extends Image<?,IMAGE>> FlickrImageDataset<IMAGE> createFromSearch(InputStreamObjectReader<IMAGE> reader, FlickrAPIToken token, com.aetrion.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.aetrion.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