gate.corpora
Class CorpusImpl

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractSet
              |
              +--java.util.TreeSet
                    |
                    +--gate.corpora.CorpusImpl
All Implemented Interfaces:
Cloneable, Collection, Corpus, FeatureBearer, LanguageResource, Resource, Serializable, Set, SortedSet
Direct Known Subclasses:
CorpusWrapper

public class CorpusImpl
extends TreeSet
implements Corpus

Corpora are sets of Document. They are ordered by lexicographic collation on Url.

See Also:
Serialized Form

Field Summary
protected  DataStore dataStore
          The data store this LR lives in.
private static boolean DEBUG
          Debug flag
protected  FeatureMap features
          The features associated with this corpus.
protected  String name
          The name of the corpus
(package private) static long serialVersionUID
          Freeze the serialization UID.
 
Fields inherited from class java.util.TreeSet
keySet, m, PRESENT
 
Constructor Summary
CorpusImpl()
          Construction
 
Method Summary
 boolean equals(Object other)
           
 DataStore getDataStore()
          Get the data store the document lives in.
 FeatureMap getFeatures()
          Get the features associated with this corpus.
 String getName()
          Get the name of the corpus.
 int hashCode()
          A Hash value for this corpus
 Resource init()
          Initialise this resource, and return it.
 void setDataStore(DataStore dataStore)
          Set the data store that this LR lives in.
 void setFeatures(FeatureMap features)
          Set the feature set
 void setName(String name)
          Set the name of the corpus.
 void sync()
          Save: synchonise the in-memory image of the corpus with the persistent image.
 
Methods inherited from class java.util.TreeSet
, add, addAll, clear, clone, comparator, contains, first, headSet, isEmpty, iterator, last, readObject, remove, size, subSet, tailSet, writeObject
 
Methods inherited from class java.util.AbstractSet
removeAll
 
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 
Methods inherited from interface java.util.SortedSet
comparator, first, headSet, last, subSet, tailSet
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Field Detail

DEBUG

private static final boolean DEBUG
Debug flag

dataStore

protected transient DataStore dataStore
The data store this LR lives in.

name

protected String name
The name of the corpus

features

protected FeatureMap features
The features associated with this corpus.

serialVersionUID

static final long serialVersionUID
Freeze the serialization UID.
Constructor Detail

CorpusImpl

public CorpusImpl()
Construction
Method Detail

init

public Resource init()
Initialise this resource, and return it.
Specified by:
init in interface Resource

getName

public String getName()
Get the name of the corpus.
Specified by:
getName in interface Corpus

setName

public void setName(String name)
Set the name of the corpus.
Specified by:
setName in interface Corpus

getDataStore

public DataStore getDataStore()
Get the data store the document lives in.
Specified by:
getDataStore in interface LanguageResource

setDataStore

public void setDataStore(DataStore dataStore)
                  throws PersistenceException
Set the data store that this LR lives in.
Specified by:
setDataStore in interface LanguageResource

sync

public void sync()
          throws PersistenceException
Save: synchonise the in-memory image of the corpus with the persistent image.
Specified by:
sync in interface LanguageResource

getFeatures

public FeatureMap getFeatures()
Get the features associated with this corpus.
Specified by:
getFeatures in interface FeatureBearer

setFeatures

public void setFeatures(FeatureMap features)
Set the feature set
Specified by:
setFeatures in interface FeatureBearer

equals

public boolean equals(Object other)
Specified by:
equals in interface Set
Overrides:
equals in class AbstractSet

hashCode

public int hashCode()
A Hash value for this corpus
Specified by:
hashCode in interface Set
Overrides:
hashCode in class AbstractSet