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 InfoItem
extract(InfoItemExtractor extractor)
Try to extract the item from an extractor without adding it to the collectionjava.util.List<java.lang.Throwable>
getErrors()
Get all errorsvoid
reset()
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:Collector
Get all errors- Specified by:
getErrors
in interfaceCollector<InfoItem,InfoItemExtractor>
- Overrides:
getErrors
in classInfoItemsCollector<InfoItem,InfoItemExtractor>
- Returns:
- the errors
-
reset
public void reset()
Description copied from interface:Collector
Reset all collected items and errors- Specified by:
reset
in interfaceCollector<InfoItem,InfoItemExtractor>
- Overrides:
reset
in classInfoItemsCollector<InfoItem,InfoItemExtractor>
-
extract
public InfoItem extract(InfoItemExtractor extractor) throws ParsingException
Description copied from interface:Collector
Try 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.
-
-