X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fsearchable%2FBasicSearchable.java;h=0449b818caa9ec88f9557acaa67460bfce084382;hb=1c959f56ec88bde48b9de66582d90d8f658fe12a;hp=ecc1da1ef3393f2b8144c8a613b56c8343c3a458;hpb=76ec935e19dbd00dfbcaaeabfc187125f727b5ac;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/searchable/BasicSearchable.java b/src/be/nikiroo/fanfix/searchable/BasicSearchable.java index ecc1da1..0449b81 100644 --- a/src/be/nikiroo/fanfix/searchable/BasicSearchable.java +++ b/src/be/nikiroo/fanfix/searchable/BasicSearchable.java @@ -83,7 +83,21 @@ public abstract class BasicSearchable { * @throws IOException * in case of I/O error */ - abstract protected void fillTag(SearchableTag tag) throws IOException; + abstract public void fillTag(SearchableTag tag) throws IOException; + + /** + * Search for the given term and return the number of pages of results of + * stories satisfying this search term. + * + * @param search + * the term to search for + * + * @return a number of pages + * + * @throws IOException + * in case of I/O error + */ + abstract public int searchPages(String search) throws IOException; /** * Search for the given term and return a list of stories satisfying this @@ -96,13 +110,16 @@ public abstract class BasicSearchable { * * @param search * the term to search for + * @param page + * the page to use for result pagination, index is 1-based * * @return a list of stories that satisfy that search term * * @throws IOException * in case of I/O error */ - abstract public List search(String search) throws IOException; + abstract public List search(String search, int page) + throws IOException; /** * Search for the given tag and return a list of stories satisfying this @@ -113,15 +130,20 @@ public abstract class BasicSearchable { *

* URL is guaranteed to be usable, LUID will always be NULL. * - * @param tagId + * @param tag * the tag to search for + * @param page + * the page to use for result pagination (see + * {@link SearchableTag#getPages()}, remember to check for -1), + * index is 1-based * * @return a list of stories that satisfy that search term * * @throws IOException * in case of I/O error */ - abstract public List search(SearchableTag tag) throws IOException; + abstract public List search(SearchableTag tag, int page) + throws IOException; /** * Load a document from its url. @@ -190,7 +212,7 @@ public abstract class BasicSearchable { // TODO break; case MANGA_LEL: - // TODO + support = new MangaLel(); break; case CBZ: case HTML: