Corpus.java
01 /*
02  *  Corpus.java
03  *
04  *  Copyright (c) 1995-2010, The University of Sheffield. See the file
05  *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
06  *
07  *  This file is part of GATE (see http://gate.ac.uk/), and is free
08  *  software, licenced under the GNU Library General Public License,
09  *  Version 2, June 1991 (in the distribution as file licence.html,
10  *  and also available at http://gate.ac.uk/gate/licence.html).
11  *
12  *  Hamish Cunningham, 19/Jan/2000
13  *
14  *  $Id: Corpus.java 12925 2010-08-04 16:12:31Z bensonmargulies $
15  */
16 
17 package gate;
18 import java.util.List;
19 
20 import gate.event.CorpusListener;
21 
22 /** Corpora are lists of Document. TIPSTER equivalent: Collection.
23   */
24 public interface Corpus extends SimpleCorpus {
25 
26   /**
27    * Unloads the document from memory. Only needed if memory
28    * preservation is an issue. Only supported for Corpus which is
29    * stored in a Datastore. To get this document back in memory,
30    * use get() on Corpus or if you have its persistent ID, request it
31    * from the Factory.
32    <P>
33    * Transient Corpus objects do nothing,
34    * because there would be no way to get the document back
35    * again afterwards.
36    @param doc Document to be unloaded from memory.
37    @return void.
38    */
39   public void unloadDocument(Document doc);
40 
41   /**
42    * This method returns true when the document is already loaded in memory.
43    * The transient corpora will always return true as they can only contain
44    * documents that are present in the memory.
45    */
46   public boolean isDocumentLoaded(int index);
47 
48 
49   /**
50    * Removes one of the listeners registered with this corpus.
51    @param l the listener to be removed.
52    */
53   public void removeCorpusListener(CorpusListener l);
54 
55   /**
56    * Registers a new {@link CorpusListener} with this corpus.
57    @param l the listener to be added.
58    */
59   public void addCorpusListener(CorpusListener l);
60 
61 // interface Corpus