NewPipeExtractor/ListExtractor.java
Mauricio Colli bda65e83d6 Refactor Extractor
- Renaming and removal of duplicate code
- New base class for list extractors
2017-07-09 19:56:35 -03:00

33 lines
920 B
Java

package org.schabi.newpipe.extractor;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.extractor.stream.StreamInfoItemCollector;
import java.io.IOException;
/**
* Base class to extractors that have a list (e.g. playlists, channels).
*/
public abstract class ListExtractor extends Extractor {
protected String nextStreamsUrl;
public ListExtractor(UrlIdHandler urlIdHandler, int serviceId, String url) {
super(urlIdHandler, serviceId, url);
}
public boolean hasMoreStreams(){
return nextStreamsUrl != null && !nextStreamsUrl.isEmpty();
}
public abstract StreamInfoItemCollector getNextStreams() throws ExtractionException, IOException;
public String getNextStreamsUrl() {
return nextStreamsUrl;
}
public void setNextStreamsUrl(String nextStreamsUrl) {
this.nextStreamsUrl = nextStreamsUrl;
}
}