gate.corpora
Class DatabaseCorpusImpl
java.lang.Object
|
+--gate.util.AbstractFeatureBearer
|
+--gate.creole.AbstractResource
|
+--gate.creole.AbstractLanguageResource
|
+--gate.corpora.CorpusImpl
|
+--gate.corpora.DatabaseCorpusImpl
- All Implemented Interfaces:
- Collection, Corpus, CreoleListener, DatastoreListener, EventAwareCorpus, EventAwareLanguageResource, EventListener, FeatureBearer, LanguageResource, List, NameBearer, Resource, Serializable
- public class DatabaseCorpusImpl
- extends CorpusImpl
- implements DatastoreListener, EventAwareCorpus
- See Also:
- Serialized Form
Methods inherited from class gate.corpora.CorpusImpl |
addCorpusListener, clear, clearDocList, containsAll, datastoreClosed, datastoreCreated, datastoreOpened, equals, fireDocumentAdded, fireDocumentRemoved, getDocumentsList, hashCode, indexOf, init, isDocumentLoaded, isEmpty, lastIndexOf, listIterator, listIterator, populate, populate, removeAll, removeCorpusListener, resourceLoaded, resourceRenamed, resourceUnloaded, retainAll, set, setDocumentsList, size, subList, toArray, toArray, unloadDocument |
Methods inherited from class java.lang.Object |
, clone, finalize, getClass, notify, notifyAll, registerNatives, toString, wait, wait, wait |
DEBUG
private static final boolean DEBUG
- Debug flag
featuresChanged
private boolean featuresChanged
nameChanged
private boolean nameChanged
eventHandler
protected DatabaseCorpusImpl.EventsHandler eventHandler
- The listener for the events coming from the features.
documentData
protected List documentData
removedDocuments
protected List removedDocuments
DatabaseCorpusImpl
public DatabaseCorpusImpl()
DatabaseCorpusImpl
public DatabaseCorpusImpl(String _name,
DatabaseDataStore _ds,
Long _persistenceID,
FeatureMap _features,
Vector _dbDocs)
add
public boolean add(Object o)
- Overrides:
add
in class CorpusImpl
add
public void add(int index,
Object element)
- Overrides:
add
in class CorpusImpl
addAll
public boolean addAll(Collection c)
- Overrides:
addAll
in class CorpusImpl
addAll
public boolean addAll(int index,
Collection c)
- Overrides:
addAll
in class CorpusImpl
isValidForAdoption
private boolean isValidForAdoption(LanguageResource lr)
resourceAdopted
public void resourceAdopted(DatastoreEvent evt)
- Description copied from interface:
DatastoreListener
- Called by a datastore when a new resource has been adopted
- Specified by:
resourceAdopted
in interface DatastoreListener
resourceDeleted
public void resourceDeleted(DatastoreEvent evt)
- Description copied from interface:
DatastoreListener
- Called by a datastore when a resource has been deleted
- Specified by:
resourceDeleted
in interface DatastoreListener
resourceWritten
public void resourceWritten(DatastoreEvent evt)
- Description copied from interface:
DatastoreListener
- Called by a datastore when a resource has been wrote into the datastore
- Specified by:
resourceWritten
in interface DatastoreListener
isResourceChanged
public boolean isResourceChanged(int changeType)
- Specified by:
isResourceChanged
in interface EventAwareLanguageResource
isModified
public boolean isModified()
- Returns true of an LR has been modified since the last sync.
Always returns false for transient LRs.
- Overrides:
isModified
in class AbstractLanguageResource
setName
public void setName(String name)
- Sets the name of this resource
- Overrides:
setName
in class AbstractResource
setFeatures
public void setFeatures(FeatureMap features)
- Set the feature set
- Overrides:
setFeatures
in class AbstractFeatureBearer
cleanup
public void cleanup()
- Overriden to remove the features listener, when the document is closed.
- Overrides:
cleanup
in class CorpusImpl
setInitData__$$__
public void setInitData__$$__(Object data)
getInitData__$$__
public Object getInitData__$$__(Object initData)
getDocumentNames
public List getDocumentNames()
- Gets the names of the documents in this corpus.
- Overrides:
getDocumentNames
in class CorpusImpl
- Returns:
- a
List
of Strings representing the names of the documents
in this corpus.
getDocumentName
public String getDocumentName(int index)
- Gets the name of a document in this corpus.
- Overrides:
getDocumentName
in class CorpusImpl
- Parameters:
index
- the index of the document- Returns:
- a String value representing the name of the document at
index in this corpus.
get
public Object get(int index)
- returns a document in the coprus by index
- Overrides:
get
in class CorpusImpl
- Parameters:
index
- the index of the document- Returns:
- an Object value representing DatabaseDocumentImpl
remove
public Object remove(int index)
- Overrides:
remove
in class CorpusImpl
remove
public boolean remove(Object obj)
- Overrides:
remove
in class CorpusImpl
findDocument
public int findDocument(Document doc)
contains
public boolean contains(Object o)
- Overrides:
contains
in class CorpusImpl
iterator
public Iterator iterator()
- Overrides:
iterator
in class CorpusImpl
getLoadedDocuments
public List getLoadedDocuments()
- Specified by:
getLoadedDocuments
in interface EventAwareCorpus
getRemovedDocuments
public List getRemovedDocuments()
- Specified by:
getRemovedDocuments
in interface EventAwareCorpus