View Javadoc
1   package us.codecraft.webmagic.selector;
2   
3   import java.util.List;
4   
5   /**
6    * Selector(extractor) for text.<br>
7    *
8    * @author code4crafter@gmail.com <br>
9    * @since 0.1.0
10   */
11  public interface Selector {
12  
13      /**
14       * Extract single result in text.<br>
15       * If there are more than one result, only the first will be chosen.
16       *
17       * @param text text
18       * @return result
19       */
20      public String select(String text);
21  
22      /**
23       * Extract all results in text.<br>
24       *
25       * @param text text
26       * @return results
27       */
28      public List<String> selectList(String text);
29  
30  }