Jet.Tipster
Class DocumentCollection

java.lang.Object
  extended byJet.Tipster.DocumentCollection

public class DocumentCollection
extends java.lang.Object

a set of ExternalDocuments.

The DocumentCollection is represented by a file with one line for each ExternalDocument in the DocumentCollection. The line consist of either

Currently types 'sgml' and 'pos' are supported. If the file name of the Document is a relative path, it is interpreted as relative to the directory containing the DocumentCollection file.


Constructor Summary
DocumentCollection(java.lang.String fileName)
          create a new DocumentCollection based on file 'fileName'.
 
Method Summary
 ExternalDocument get(int i)
          returns the i-th document in the Collection.
 java.lang.String getName()
          returns the fileName (not the full path) of the Collection.
 boolean open()
          read the information about the Collection from an external file.
 void save()
          save all the Documents in the Collection.
 void saveAs(java.lang.String newFileName)
          save the Collection to file 'newFileName', and then save all the Documents in the Collection.
 int size()
          returns the number of documents in the Collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentCollection

public DocumentCollection(java.lang.String fileName)
create a new DocumentCollection based on file 'fileName'.

Method Detail

open

public boolean open()
read the information about the Collection from an external file. A DocumentCollection must be opened before other operations can be performed on the collection.


save

public void save()
save all the Documents in the Collection. This assumes that the Collection and all its Documents are open.


saveAs

public void saveAs(java.lang.String newFileName)
save the Collection to file 'newFileName', and then save all the Documents in the Collection. If the Documents in the Collection are specified by relative file names, the Documents will be saved as new files whose paths are relative to 'newFileName'. This operation assumes that the Collection and all its Documents are open.


size

public int size()
returns the number of documents in the Collection.


get

public ExternalDocument get(int i)
returns the i-th document in the Collection.


getName

public java.lang.String getName()
returns the fileName (not the full path) of the Collection.