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 void
addError(java.lang.Exception error)
Add an errorprotected void
addItem(I item)
Add an itemvoid
commit(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 itemsint
getServiceId()
Get the service idvoid
reset()
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:Collector
Get all items
-
getErrors
public java.util.List<java.lang.Throwable> getErrors()
Description copied from interface:Collector
Get all errors
-
reset
public void reset()
Description copied from interface:Collector
Reset 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
-
-