Package org.dspace.discovery
Class DiscoverResultItemIterator
java.lang.Object
org.dspace.discovery.DiscoverResultIterator<Item,UUID>
org.dspace.discovery.DiscoverResultItemIterator
An iterator for discovering and iterating over DSpace items from the search index.
This class extends
DiscoverResultIterator and provides the logic to
handle different types of indexable objects and retrieve the corresponding DSpace items.
It supports the following indexable object types:
Throws an IllegalStateException if the object type is not recognized.
- Author:
- Luca Giamminonni (luca.giamminonni at 4science.it)
-
Constructor Summary
ConstructorsConstructorDescriptionDiscoverResultItemIterator(Context context, DiscoverQuery discoverQuery) Constructs an iterator for discovering items based on the given context and query.DiscoverResultItemIterator(Context context, DiscoverQuery discoverQuery, boolean uncacheEntities) Constructs an iterator with the option to uncache entities.DiscoverResultItemIterator(Context context, DiscoverQuery discoverQuery, int maxResults) Constructs an iterator with a limit on the maximum number of results.DiscoverResultItemIterator(Context context, IndexableObject<?, ?> scopeObject, DiscoverQuery discoverQuery) Constructs an iterator within a specific scope object.DiscoverResultItemIterator(Context context, IndexableObject<?, ?> scopeObject, DiscoverQuery discoverQuery, int maxResults) Constructs an iterator with a scope object and a limit on the maximum number of results. -
Method Summary
Methods inherited from class org.dspace.discovery.DiscoverResultIterator
getNextIndexableObject, getTotalSearchResults, hasNextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
DiscoverResultItemIterator
Constructs an iterator for discovering items based on the given context and query.- Parameters:
context- the DSpace contextdiscoverQuery- the discovery query
-
DiscoverResultItemIterator
public DiscoverResultItemIterator(Context context, DiscoverQuery discoverQuery, boolean uncacheEntities) Constructs an iterator with the option to uncache entities.- Parameters:
context- the DSpace contextdiscoverQuery- the discovery queryuncacheEntities- whether to uncache entities after iteration
-
DiscoverResultItemIterator
public DiscoverResultItemIterator(Context context, IndexableObject<?, ?> scopeObject, DiscoverQuery discoverQuery) Constructs an iterator within a specific scope object.- Parameters:
context- the DSpace contextscopeObject- the scope objectdiscoverQuery- the discovery query
-
DiscoverResultItemIterator
Constructs an iterator with a limit on the maximum number of results.- Parameters:
context- the DSpace contextdiscoverQuery- the discovery querymaxResults- the maximum number of results to return
-
DiscoverResultItemIterator
public DiscoverResultItemIterator(Context context, IndexableObject<?, ?> scopeObject, DiscoverQuery discoverQuery, int maxResults) Constructs an iterator with a scope object and a limit on the maximum number of results.- Parameters:
context- the DSpace contextscopeObject- the scope objectdiscoverQuery- the discovery querymaxResults- the maximum number of results to return
-
-
Method Details
-
next
Retrieves the nextItemfrom the iterator. The item is obtained by determining the type of the next indexable object and extracting the corresponding item.- Specified by:
nextin interfaceIterator<Item>- Overrides:
nextin classDiscoverResultIterator<Item,UUID> - Returns:
- the next DSpace item
- Throws:
IllegalStateException- if the object type is invalid
-