Package org.ametys.cms.search.solr
Class AbstractResponseIterator<O>
- java.lang.Object
-
- org.ametys.cms.search.solr.AbstractResponseIterator<O>
-
- Type Parameters:
O
- the type of elements returned by this iterator
- All Implemented Interfaces:
Iterator<O>
,SearchResultsIterator<O>
- Direct Known Subclasses:
SolrResponseAmetysObjectIterator
,SolrResponseIterable.SolrResponseIterator
abstract class AbstractResponseIterator<O> extends Object implements SearchResultsIterator<O>
This abstract iterator is here for providing common code to an iterator over SearchResult and to an AmetysObjectIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected AmetysObjectResolver
_ametysObjectResolver
private long
_errors
private Iterator<org.apache.solr.common.SolrDocument>
_it
private org.slf4j.Logger
_logger
private O
_nextObject
private int
_position
private long
_size
-
Constructor Summary
Constructors Constructor Description AbstractResponseIterator(Iterator<org.apache.solr.common.SolrDocument> it, long size, AmetysObjectResolver resolver, org.slf4j.Logger logger)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract O
_setNextObject(org.apache.solr.common.SolrDocument document, String id)
long
getPosition()
long
getSize()
boolean
hasNext()
O
next()
void
skip(long skipNum)
Skip a number of elements in the iterator.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Field Detail
-
_ametysObjectResolver
protected AmetysObjectResolver _ametysObjectResolver
-
_nextObject
private O _nextObject
-
_position
private int _position
-
_size
private long _size
-
_errors
private long _errors
-
_logger
private org.slf4j.Logger _logger
-
-
Constructor Detail
-
AbstractResponseIterator
public AbstractResponseIterator(Iterator<org.apache.solr.common.SolrDocument> it, long size, AmetysObjectResolver resolver, org.slf4j.Logger logger)
-
-
Method Detail
-
_setNextObject
protected abstract O _setNextObject(org.apache.solr.common.SolrDocument document, String id)
-
getPosition
public long getPosition()
-
getSize
public long getSize()
-
skip
public void skip(long skipNum)
Description copied from interface:SearchResultsIterator
Skip a number of elements in the iterator.- Specified by:
skip
in interfaceSearchResultsIterator<O>
- Parameters:
skipNum
- the non-negative number of elements to skip
-
-