filetools.filesearchtools
Class MatlabfunctionFileSearch

java.lang.Object
  extended by filetools.filesearchtools.SimpleFileSearch
      extended by filetools.filesearchtools.MatlabfunctionFileSearch
All Implemented Interfaces:
IFileSearch

public class MatlabfunctionFileSearch
extends SimpleFileSearch

Author:
osiris

Field Summary
static java.lang.String DEFAULT_FILENAME
           
static java.lang.String DEFAULT_SYNCFILENAME
           
private  java.util.Vector<java.lang.String> dirExceptions
          Keeps a list of directory names which shouldn't be searched
private static java.lang.String HTML_EXTENSION
           
protected  java.io.FileWriter outputFileWriter
           
protected  java.util.Vector<java.lang.String> syncDirs
          List of directories which will be searched for the helpfiles
protected  boolean syncExisting
          Specifies if files with (true) or without (false) a corresponding helpfile will be listed in the syncfile
protected  java.io.FileWriter syncFileWriter
           
 
Constructor Summary
MatlabfunctionFileSearch(java.io.File outputFile, java.io.File syncFile, java.util.Vector<java.lang.String> syncDirs, boolean syncExisting)
          Only constructor.
 
Method Summary
protected  boolean isDirToSearch(java.lang.String dir)
          Derived classes need to define here which directories should be searched.
protected  boolean isSearchedFileName(java.lang.String filename)
          Derived classes need to define here which files are searched.
private  boolean isSynchronizing()
          Tells if a syncfile is requested.
static void main(java.lang.String[] args)
          Starts a new file-search with the specified params
protected  void processFile(java.io.File file)
          Here concrete classes need to define what to do with a searched file which was found.
private  boolean startsWithUppercase(java.lang.String string)
          Tells if the given string starts with an uppercase letter.
 
Methods inherited from class filetools.filesearchtools.SimpleFileSearch
searchDir
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FILENAME

public static final java.lang.String DEFAULT_FILENAME
See Also:
Constant Field Values

DEFAULT_SYNCFILENAME

public static final java.lang.String DEFAULT_SYNCFILENAME
See Also:
Constant Field Values

HTML_EXTENSION

private static final java.lang.String HTML_EXTENSION
See Also:
Constant Field Values

outputFileWriter

protected java.io.FileWriter outputFileWriter

syncFileWriter

protected java.io.FileWriter syncFileWriter

dirExceptions

private java.util.Vector<java.lang.String> dirExceptions
Keeps a list of directory names which shouldn't be searched


syncDirs

protected java.util.Vector<java.lang.String> syncDirs
List of directories which will be searched for the helpfiles


syncExisting

protected boolean syncExisting
Specifies if files with (true) or without (false) a corresponding helpfile will be listed in the syncfile

Constructor Detail

MatlabfunctionFileSearch

public MatlabfunctionFileSearch(java.io.File outputFile,
                                java.io.File syncFile,
                                java.util.Vector<java.lang.String> syncDirs,
                                boolean syncExisting)
Only constructor. Tries to create the output files and does the initialisation.

Parameters:
outputFile - File in which the list of found functions will be written
syncFile - File in which the output of the syncronizing process will be written
syncDirs - List of directories which will be searched for the helpfiles
syncExisting - Specifies if files with (true) or without (false) a corresponding helpfile will be listed in the syncfile
Method Detail

main

public static void main(java.lang.String[] args)
Starts a new file-search with the specified params

Parameters:
args - Contains the filenames and directories

processFile

protected void processFile(java.io.File file)
Description copied from class: SimpleFileSearch
Here concrete classes need to define what to do with a searched file which was found.

Specified by:
processFile in class SimpleFileSearch
Parameters:
file - File object which represents the found file
See Also:
SimpleFileSearch.processFile(java.io.File)

isSynchronizing

private boolean isSynchronizing()
Tells if a syncfile is requested.

Returns:
true if a syncfile should be created

startsWithUppercase

private boolean startsWithUppercase(java.lang.String string)
Tells if the given string starts with an uppercase letter.

Parameters:
string - String to examine
Returns:
true if string starts with an uppercase letter

isDirToSearch

protected boolean isDirToSearch(java.lang.String dir)
Description copied from class: SimpleFileSearch
Derived classes need to define here which directories should be searched.

Specified by:
isDirToSearch in class SimpleFileSearch
Parameters:
dir - Name of the directory, not the whole path!
Returns:
true if this directory should be searched
See Also:
SimpleFileSearch.isDirToSearch(java.lang.String)

isSearchedFileName

protected boolean isSearchedFileName(java.lang.String filename)
Description copied from class: SimpleFileSearch
Derived classes need to define here which files are searched.

Specified by:
isSearchedFileName in class SimpleFileSearch
Parameters:
filename - Name of the file, not its path!
Returns:
true if this is a searched file
See Also:
SimpleFileSearch.isSearchedFileName(java.lang.String)