All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Webcrawler.Controller.StringFinder

java.lang.Object
   |
   +----Webcrawler.Controller.Controller
           |
           +----Webcrawler.Controller.StringFinder

public class StringFinder
extends Controller
implements ActionListener
This is a controller for finding a String. Before the local file is deleted, this controller checks if the specified String can be found in the HTML-code. The Node that the String can be found in is added to the FoundIn-list. Supports case-sensitive and case-insensitive search. All local files are deleted, only HTML-files are being loaded.

See Also:
Controller

Variable Index

 o caseSensitiveBox
 o fileNum
 o foundList
 o foundVector
 o readyToDelete
 o searchForField

Constructor Index

 o StringFinder()
Creates a new StringFinder-Controller (with window).

Method Index

 o actionPerformed(ActionEvent)
Catches the ActionEvents when one of the buttons in the "General"-tab was pressed always call super.actionEvent(e) in subclasses at the end of the subclass' method
 o crawlerDone()
Deletes all the temporary files.
 o everySecond()
Deletes the temporary files if readyToDelete is true.
 o findString(HTMLNode)
 o foundIn(HTMLNode)
 o loadCurrSettings()
This method is called from the superclass' actionPerformed method.
 o loadLink(LoadableNode)
The StringFinder loads HTMLNodes only
 o localFileName(LoadableNode)
 o nodeDone(URLNode)
Sets the localFile field of n invalid, because when the Crawler is done crawling, all the local files will be deleted.
 o nodeLoaded(URLNode)
Searches the local file for the specified String.
 o saveCurrSettings()
This method is called from the superclass' actionPerformed method.

Variables

 o foundVector
 protected Vector foundVector
 o searchForField
 protected JTextField searchForField
 o caseSensitiveBox
 protected JCheckBox caseSensitiveBox
 o foundList
 protected JList foundList
 o fileNum
 private int fileNum
 o readyToDelete
 private boolean readyToDelete

Constructors

 o StringFinder
 public StringFinder()
Creates a new StringFinder-Controller (with window).

Methods

 o actionPerformed
 public void actionPerformed(ActionEvent e)
Catches the ActionEvents when one of the buttons in the "General"-tab was pressed always call super.actionEvent(e) in subclasses at the end of the subclass' method

Overrides:
actionPerformed in class Controller
 o saveCurrSettings
 protected void saveCurrSettings()
This method is called from the superclass' actionPerformed method. Here the entries of the StringFinder-tab are stored to set\strfnd.dat

Overrides:
saveCurrSettings in class Controller
 o loadCurrSettings
 protected void loadCurrSettings()
This method is called from the superclass' actionPerformed method. Here the entries of the StringFinder-tab are loaded from set\strfnd.dat

Overrides:
loadCurrSettings in class Controller
 o everySecond
 protected void everySecond()
Deletes the temporary files if readyToDelete is true. Please see Grabber for details on deleting temporary files and why this method is doing it.

Overrides:
everySecond in class Controller
See Also:
Grabber
 o loadLink
 public boolean loadLink(LoadableNode n)
The StringFinder loads HTMLNodes only

Overrides:
loadLink in class Controller
 o localFileName
 public String localFileName(LoadableNode n)
Returns:
a temporary file name (here: number.html)
Overrides:
localFileName in class Controller
 o nodeLoaded
 public void nodeLoaded(URLNode n)
Searches the local file for the specified String.

Overrides:
nodeLoaded in class Controller
 o findString
 private void findString(HTMLNode n)
 o foundIn
 private void foundIn(HTMLNode n)
 o nodeDone
 public void nodeDone(URLNode n)
Sets the localFile field of n invalid, because when the Crawler is done crawling, all the local files will be deleted.

Overrides:
nodeDone in class Controller
 o crawlerDone
 public void crawlerDone()
Deletes all the temporary files.

Overrides:
crawlerDone in class Controller

All Packages  Class Hierarchy  This Package  Previous  Next  Index