gate.event
Class CorpusEvent
java.lang.Object
|
+--java.util.EventObject
|
+--gate.event.GateEvent
|
+--gate.event.CorpusEvent
- All Implemented Interfaces:
- Serializable
- public class CorpusEvent
- extends GateEvent
Models events fired by corpora when documents are added or removed.
- See Also:
- Serialized Form
Field Summary |
private Document |
document
The document that has been added/removed. |
static int |
DOCUMENT_ADDED
Event type that is fired when a new document is added to a corpus |
static int |
DOCUMENT_REMOVED
Event type that is fired when a document is removed from a corpus |
private int |
documentIndex
The index of the document which has been removed. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
DOCUMENT_ADDED
public static final int DOCUMENT_ADDED
- Event type that is fired when a new document is added to a corpus
DOCUMENT_REMOVED
public static final int DOCUMENT_REMOVED
- Event type that is fired when a document is removed from a corpus
document
private Document document
- The document that has been added/removed.
documentIndex
private int documentIndex
- The index of the document which has been removed. Needed because
the document itself might not have been loaded in memory, so the
index could be used instead.
CorpusEvent
public CorpusEvent(Corpus source,
Document doc,
int index,
int type)
- Creates a new CorpusEvent.
- Parameters:
source
- the corpus that fires the eventdoc
- the document this event refers totype
- the type of event (DOCUMENT_ADDED
or
DOCUMENT_REMOVED
).
getDocument
public Document getDocument()
- Gets the dcument this event refers to
getDocumentIndex
public int getDocumentIndex()
- Gets the index of the dcument this event refers to