Package org.schabi.newpipe.extractor
Class InfoItemsCollector<I extends InfoItem,E extends InfoItemExtractor>
- java.lang.Object
-
- org.schabi.newpipe.extractor.InfoItemsCollector<I,E>
-
- All Implemented Interfaces:
Collector<I,E>
- Direct Known Subclasses:
ChannelInfoItemsCollector,CommentsInfoItemsCollector,MultiInfoItemsCollector,PlaylistInfoItemsCollector,StreamInfoItemsCollector
public abstract class InfoItemsCollector<I extends InfoItem,E extends InfoItemExtractor> extends java.lang.Object implements Collector<I,E>
-
-
Constructor Summary
Constructors Constructor Description InfoItemsCollector(int serviceId)Create a new collector with no comparator / sorting functionInfoItemsCollector(int serviceId, java.util.Comparator<I> comparator)Create a new collector
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddError(java.lang.Exception error)Add an errorprotected voidaddItem(I item)Add an itemvoidcommit(E extractor)Try to add an extractor to the collectionjava.util.List<java.lang.Throwable>getErrors()Get all errorsjava.util.List<I>getItems()Get all itemsintgetServiceId()Get the service idvoidreset()Reset all collected items and errors
-
-
-
Constructor Detail
-
InfoItemsCollector
public InfoItemsCollector(int serviceId)
Create a new collector with no comparator / sorting function- Parameters:
serviceId- the service id
-
InfoItemsCollector
public InfoItemsCollector(int serviceId, @Nullable java.util.Comparator<I> comparator)Create a new collector- Parameters:
serviceId- the service id
-
-
Method Detail
-
getItems
public java.util.List<I> getItems()
Description copied from interface:CollectorGet all items
-
getErrors
public java.util.List<java.lang.Throwable> getErrors()
Description copied from interface:CollectorGet all errors
-
reset
public void reset()
Description copied from interface:CollectorReset all collected items and errors
-
addError
protected void addError(java.lang.Exception error)
Add an error- Parameters:
error- the error
-
addItem
protected void addItem(I item)
Add an item- Parameters:
item- the item
-
getServiceId
public int getServiceId()
Get the service id- Returns:
- the service id
-
-