View Javadoc

1   package net.obsearch.index.utils;
2   
3   import net.obsearch.OB;
4   import net.obsearch.exception.OBException;
5   
6   
7   /**
8    * Instantiates objects from string lines.
9    * @author amuller
10   *
11   */
12  public interface OBFactory <O extends OB>{
13  
14      /**
15       * Creates a new object from the given String.
16       * @param x The string to use to instantiate the obj.
17       * @return The object.
18       */
19      O create(String x) throws OBException;
20      
21      /**
22       * Returns true if we should process (add / search) the given
23       * object.
24       * @return true if we should process (add / search) the given
25       * object.
26       */
27      boolean shouldProcess(O obj)throws OBException ;
28  }