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, EventAwareLanguageResource, EventListener, FeatureBearer, LanguageResource, List, NameBearer, Resource, Serializable

public class DatabaseCorpusImpl
extends CorpusImpl
implements DatastoreListener, EventAwareLanguageResource

See Also:
Serialized Form

Inner Class Summary
(package private)  class DatabaseCorpusImpl.EventsHandler
          All the events from the features are handled by this inner class.
 
Inner classes inherited from class gate.corpora.CorpusImpl
CorpusImpl.VerboseList
 
Field Summary
protected  DatabaseCorpusImpl.EventsHandler eventHandler
          The listener for the events coming from the features.
private  boolean featuresChanged
           
private  boolean nameChanged
           
 
Fields inherited from class gate.corpora.CorpusImpl
corpusListeners, DEBUG, documentsList, serialVersionUID, supportList
 
Fields inherited from class gate.creole.AbstractLanguageResource
dataStore, lrPersistentId
 
Fields inherited from class gate.creole.AbstractResource
name
 
Fields inherited from class gate.util.AbstractFeatureBearer
features
 
Fields inherited from interface gate.corpora.EventAwareLanguageResource
DOC_CONTENT, DOC_MAIN, RES_FEATURES, RES_NAME
 
Constructor Summary
DatabaseCorpusImpl(String _name, DatabaseDataStore _ds, Long _persistenceID, FeatureMap _features, Vector _dbDocs)
           
 
Method Summary
 void add(int index, Object element)
           
 boolean add(Object o)
           
 boolean addAll(Collection c)
           
 boolean addAll(int index, Collection c)
           
 void cleanup()
          Overriden to remove the features listener, when the document is closed.
 boolean isResourceChanged(int changeType)
           
private  boolean isValidForAdoption(LanguageResource lr)
           
 void resourceAdopted(DatastoreEvent evt)
          Called by a datastore when a new resource has been adopted
 void resourceDeleted(DatastoreEvent evt)
          Called by a datastore when a resource has been deleted
 void resourceWritten(DatastoreEvent evt)
          Called by a datastore when a resource has been wrote into the datastore
 void setFeatures(FeatureMap features)
          Set the feature set
 void setName(String name)
          Sets the name of this resource
 
Methods inherited from class gate.corpora.CorpusImpl
addCorpusListener, clear, clearDocList, contains, containsAll, datastoreClosed, datastoreCreated, datastoreOpened, equals, fireDocumentAdded, fireDocumentRemoved, get, getDocumentName, getDocumentNames, getDocumentsList, hashCode, indexOf, init, isDocumentLoaded, isEmpty, iterator, lastIndexOf, listIterator, listIterator, populate, populate, remove, remove, removeAll, removeCorpusListener, resourceLoaded, resourceUnloaded, retainAll, set, setDocumentsList, size, subList, toArray, toArray, unloadDocument
 
Methods inherited from class gate.creole.AbstractLanguageResource
getDataStore, getLRPersistenceId, setDataStore, setLRPersistenceId, sync
 
Methods inherited from class gate.creole.AbstractResource
checkParameterValues, getName, getParameterValue, getParameterValue, removeResourceListeners, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners
 
Methods inherited from class gate.util.AbstractFeatureBearer
getFeatures
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, registerNatives, toString, wait, wait, wait
 
Methods inherited from interface gate.LanguageResource
getDataStore, getLRPersistenceId, setDataStore, setLRPersistenceId, sync
 
Methods inherited from interface gate.Resource
getParameterValue, setParameterValue, setParameterValues
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures
 
Methods inherited from interface gate.util.NameBearer
getName
 

Field Detail

featuresChanged

private boolean featuresChanged

nameChanged

private boolean nameChanged

eventHandler

protected DatabaseCorpusImpl.EventsHandler eventHandler
The listener for the events coming from the features.
Constructor Detail

DatabaseCorpusImpl

public DatabaseCorpusImpl(String _name,
                          DatabaseDataStore _ds,
                          Long _persistenceID,
                          FeatureMap _features,
                          Vector _dbDocs)
Method Detail

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

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