View Javadoc
1   package us.codecraft.webmagic;
2   
3   import us.codecraft.webmagic.utils.Experimental;
4   
5   import java.util.Collection;
6   
7   /**
8    * Extract an object of more than one pages, such as news and articles.<br>
9    *
10   * @author code4crafter@gmail.com <br>
11   * @since 0.2.0
12   */
13  @Experimental
14  public interface MultiPageModel {
15  
16      /**
17       * Page key is the identifier for the object.
18       *
19       * @return page key
20       */
21      public String getPageKey();
22  
23      /**
24       * page is the identifier of a page in pages for one object.
25       *
26       * @return page
27       */
28      public String getPage();
29  
30      /**
31       * other pages to be extracted.<br>
32       * It is used to judge whether an object contains more than one page, and whether the pages of the object are all extracted.
33       *
34       * @return other pages
35       */
36      public Collection<String> getOtherPages();
37  
38      /**
39       * Combine multiPageModels to a whole object.
40       *
41       * @param multiPageModel multiPageModel
42       * @return multiPageModel combined
43       */
44      public MultiPageModel combine(MultiPageModel multiPageModel);
45  
46  }