Package org.schabi.newpipe.extractor
Class MultiInfoItemsCollector
- java.lang.Object
-
- org.schabi.newpipe.extractor.InfoItemsCollector<InfoItem,InfoItemExtractor>
-
- org.schabi.newpipe.extractor.MultiInfoItemsCollector
-
- All Implemented Interfaces:
Collector<InfoItem,InfoItemExtractor>
public class MultiInfoItemsCollector extends InfoItemsCollector<InfoItem,InfoItemExtractor>
A collector that can handle many extractor types, to be used when a list contains items of different types (e.g. search)This collector can handle the following extractor types:
Callingextract(InfoItemExtractor)orInfoItemsCollector.commit(InfoItemExtractor)with any other extractor type will raise an exception.
-
-
Constructor Summary
Constructors Constructor Description MultiInfoItemsCollector(int serviceId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InfoItemextract(InfoItemExtractor extractor)Try to extract the item from an extractor without adding it to the collectionjava.util.List<java.lang.Throwable>getErrors()Get all errorsvoidreset()Reset all collected items and errors-
Methods inherited from class org.schabi.newpipe.extractor.InfoItemsCollector
addError, addItem, commit, getItems, getServiceId
-
-
-
-
Method Detail
-
getErrors
public java.util.List<java.lang.Throwable> getErrors()
Description copied from interface:CollectorGet all errors- Specified by:
getErrorsin interfaceCollector<InfoItem,InfoItemExtractor>- Overrides:
getErrorsin classInfoItemsCollector<InfoItem,InfoItemExtractor>- Returns:
- the errors
-
reset
public void reset()
Description copied from interface:CollectorReset all collected items and errors- Specified by:
resetin interfaceCollector<InfoItem,InfoItemExtractor>- Overrides:
resetin classInfoItemsCollector<InfoItem,InfoItemExtractor>
-
extract
public InfoItem extract(InfoItemExtractor extractor) throws ParsingException
Description copied from interface:CollectorTry to extract the item from an extractor without adding it to the collection- Parameters:
extractor- the extractor to use- Returns:
- the item
- Throws:
ParsingException- thrown if there is an error extracting the required fields of the item.
-
-