tp.loader
Class LoaderPlainText

java.lang.Object
  extended by 
      extended by tp.loader.LoaderPlainText
All Implemented Interfaces:
LoaderInterface

public class LoaderPlainText
extends
implements LoaderInterface

Class for loading the plain text files.


Constructor Summary
LoaderPlainText()
           
 
Method Summary
protected  java.lang.Void doInBackground()
           
 java.lang.String loadFile(java.io.File f)
          Takes one file and makes a string from ites contents, which is returned.
 DocumentsDatabase loadFromFiles(LinkToFiles link_files)
          Method for loading plain text files - one document for each file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface tp.loader.LoaderInterface
addPropertyChangeListener
 

Constructor Detail

LoaderPlainText

public LoaderPlainText()
Method Detail

loadFromFiles

public DocumentsDatabase loadFromFiles(LinkToFiles link_files)
Method for loading plain text files - one document for each file. Reads the files given by the user and returns teh database of documents.

Specified by:
loadFromFiles in interface LoaderInterface
Parameters:
link_files - links to files for loading
Returns:
reference to the database of documents

loadFile

public java.lang.String loadFile(java.io.File f)
Takes one file and makes a string from ites contents, which is returned. Redundant white characters are removed and all words are changed to lowercase.

Parameters:
f - plain text file
Returns:
string with file contents

doInBackground

protected java.lang.Void doInBackground()
                                 throws java.lang.Exception
Throws:
java.lang.Exception