tp.model
Class DocumentsDatabase

java.lang.Object
  extended by tp.model.DocumentsDatabase

public class DocumentsDatabase
extends java.lang.Object

This class serves as a transactional database of textual documents. It allows to store texts of documents and work with them.


Constructor Summary
DocumentsDatabase()
          Constructor of the class.
 
Method Summary
 void addDocument(Document document)
          Adds a document to the database.
 int getCountDocuments()
          Returns the size of database (count of documents)
 Document getDocumentAt(int index)
          Method returns a document being at a given position.
 Document getDocumentSingly()
          Method returns a document being at position next to the cursor and increments value of the cursor.
 void setDocoumentTo(int index, Document document)
          Method stores a document to a given position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentsDatabase

public DocumentsDatabase()
Constructor of the class.

Method Detail

addDocument

public void addDocument(Document document)
Adds a document to the database.

Parameters:
document - document to add

setDocoumentTo

public void setDocoumentTo(int index,
                           Document document)
Method stores a document to a given position.

Parameters:
index - position
document - document

getDocumentSingly

public Document getDocumentSingly()
Method returns a document being at position next to the cursor and increments value of the cursor.

Returns:
one document

getDocumentAt

public Document getDocumentAt(int index)
Method returns a document being at a given position.

Parameters:
index - position of a document
Returns:
a document

getCountDocuments

public int getCountDocuments()
Returns the size of database (count of documents)

Returns:
count of documents