## 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

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)`
`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, contains, containsAll, datastoreClosed, datastoreCreated, datastoreOpened, equals, 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
`getClass, notify, notifyAll, 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`

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`

### 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`