Indexer.java
01 /*
02  *  Indexer.java
03  *
04  *  Niraj Aswani, 19/March/07
05  *
06  *  $Id: Indexer.html,v 1.0 2007/03/19 16:22:01 niraj Exp $
07  */
08 package gate.creole.annic;
09 
10 import gate.Corpus;
11 
12 import java.util.List;
13 import java.util.Map;
14 import java.util.Set;
15 
16 /**
17  * Base interface that declares methods for the Indexer.
18  
19  @author niraj
20  
21  */
22 public interface Indexer {
23 
24   /**
25    * Create a Index
26    
27    @param parameters - parameters needed for creating an index values
28    *          depend on the implementing IndexManager
29    @throws IndexException
30    */
31   public void createIndex(Map parametersthrows IndexException;
32 
33   /** Optimize the existing index */
34   public void optimizeIndex() throws IndexException;
35 
36   /** Delete all index files and directories in index location. */
37   public void deleteIndex() throws IndexException;
38 
39   /**
40    * Add new documents to Index
41    
42    @param corpusPersistenceID
43    @param addedDocuments
44    @throws IndexException
45    */
46   public void add(String corpusPersistenceID, List<gate.Document> addedDocuments)
47           throws IndexException;
48 
49   /**
50    * remove documents from the Index
51    
52    @param removedDocumentPersistenceIds
53    @throws Exception
54    */
55   public void remove(List removedDocumentPersistenceIdsthrows IndexException;
56 
57   /**
58    * Set the corpus to be indexed
59    
60    @param corpus
61    */
62   public void setCorpus(Corpus corpusthrows IndexException;
63 
64   /**
65    * Corpus to be indexed
66    
67    @return
68    */
69   public Corpus getCorpus();
70 
71   /**
72    * Returns the parameters
73    
74    @return
75    */
76   public Map getParameters();
77 }