IMAGE
- The type of Image
instance held by the dataset.public class BingImageDataset<IMAGE extends Image<?,IMAGE>> extends ReadableListDataset<IMAGE,InputStream> implements Identifiable
null
if they could not be loaded.Modifier and Type | Class and Description |
---|---|
static class |
BingImageDataset.ImageDataSourceQuery |
static class |
BingImageDataset.ImageDataSourceResponse |
reader
modCount
Modifier | Constructor and Description |
---|---|
protected |
BingImageDataset(InputStreamObjectReader<IMAGE> reader,
List<BingImageDataset.ImageDataSourceResponse> results,
BingImageDataset.ImageDataSourceQuery query) |
Modifier and Type | Method and Description |
---|---|
static <IMAGE extends Image<?,IMAGE>> |
create(InputStreamObjectReader<IMAGE> reader,
BingAPIToken token,
BingImageDataset.ImageDataSourceQuery query,
int number)
Perform a search with the given query.
|
static <IMAGE extends Image<?,IMAGE>> |
create(InputStreamObjectReader<IMAGE> reader,
BingAPIToken token,
String query,
int number)
Perform a search with the given query string.
|
static <IMAGE extends Image<?,IMAGE>> |
create(InputStreamObjectReader<IMAGE> reader,
BingImageDataset.ImageDataSourceQuery query,
int number)
Perform a search with the given query.
|
String |
getID() |
BingImageDataset.ImageDataSourceResponse |
getImage(int index)
Get the specific underlying
BingImageDataset.ImageDataSourceResponse for the given
index. |
List<BingImageDataset.ImageDataSourceResponse> |
getImages()
Get the underlying
BingImageDataset.ImageDataSourceResponse objects that back the
dataset. |
IMAGE |
getInstance(int index)
Returns the instance at the specified position in this dataset.
|
static void |
main(String[] args) |
int |
numInstances()
Returns the number of instances in this dataset.
|
get, getID, getRandomInstance, indexOfID, size, toIdentifiable
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
equals
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList, toArray, toArray
parallelStream, removeIf, stream
protected BingImageDataset(InputStreamObjectReader<IMAGE> reader, List<BingImageDataset.ImageDataSourceResponse> results, BingImageDataset.ImageDataSourceQuery query)
public IMAGE getInstance(int index)
ListDataset
getInstance
in interface ListDataset<IMAGE extends Image<?,IMAGE>>
index
- index of the instance to returnpublic int numInstances()
Dataset
numInstances
in interface Dataset<IMAGE extends Image<?,IMAGE>>
public List<BingImageDataset.ImageDataSourceResponse> getImages()
BingImageDataset.ImageDataSourceResponse
objects that back the
dataset.BingImageDataset.ImageDataSourceResponse
objectspublic BingImageDataset.ImageDataSourceResponse getImage(int index)
BingImageDataset.ImageDataSourceResponse
for the given
index.index
- the indexBingImageDataset.ImageDataSourceResponse
for the given index.public static <IMAGE extends Image<?,IMAGE>> BingImageDataset<IMAGE> create(InputStreamObjectReader<IMAGE> reader, BingImageDataset.ImageDataSourceQuery query, int number)
reader
- the reader with which to load the imagesquery
- the querynumber
- the target number of results; the resultant dataset may
contain fewer images than specified.BingImageDataset
created from the query.public static <IMAGE extends Image<?,IMAGE>> BingImageDataset<IMAGE> create(InputStreamObjectReader<IMAGE> reader, BingAPIToken token, BingImageDataset.ImageDataSourceQuery query, int number)
reader
- the reader with which to load the imagestoken
- the api authentication tokenquery
- the querynumber
- the target number of results; the resultant dataset may
contain fewer images than specified.BingImageDataset
created from the query.public static <IMAGE extends Image<?,IMAGE>> BingImageDataset<IMAGE> create(InputStreamObjectReader<IMAGE> reader, BingAPIToken token, String query, int number)
reader
- the reader with which to load the imagestoken
- the api authentication tokenquery
- the querynumber
- the target number of results; the resultant dataset may
contain fewer images than specified.BingImageDataset
created from the query.public String getID()
getID
in interface Identifiable
public static void main(String[] args) throws BackingStoreException
BackingStoreException