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
-
caseSensitiveBox
-
-
fileNum
-
-
foundList
-
-
foundVector
-
-
readyToDelete
-
-
searchForField
-
-
StringFinder()
- Creates a new StringFinder-Controller (with window).
-
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
-
crawlerDone()
- Deletes all the temporary files.
-
everySecond()
- Deletes the temporary files if readyToDelete is true.
-
findString(HTMLNode)
-
-
foundIn(HTMLNode)
-
-
loadCurrSettings()
- This method is called from the superclass' actionPerformed method.
-
loadLink(LoadableNode)
- The StringFinder loads HTMLNodes only
-
localFileName(LoadableNode)
-
-
nodeDone(URLNode)
- Sets the localFile field of n invalid, because when the Crawler
is done crawling, all the local files will be deleted.
-
nodeLoaded(URLNode)
- Searches the local file for the specified String.
-
saveCurrSettings()
- This method is called from the superclass' actionPerformed method.
foundVector
protected Vector foundVector
searchForField
protected JTextField searchForField
caseSensitiveBox
protected JCheckBox caseSensitiveBox
foundList
protected JList foundList
fileNum
private int fileNum
readyToDelete
private boolean readyToDelete
StringFinder
public StringFinder()
- Creates a new StringFinder-Controller (with window).
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
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
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
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
loadLink
public boolean loadLink(LoadableNode n)
- The StringFinder loads HTMLNodes only
- Overrides:
- loadLink in class Controller
localFileName
public String localFileName(LoadableNode n)
- Returns:
- a temporary file name (here: number.html)
- Overrides:
- localFileName in class Controller
nodeLoaded
public void nodeLoaded(URLNode n)
- Searches the local file for the specified String.
- Overrides:
- nodeLoaded in class Controller
findString
private void findString(HTMLNode n)
foundIn
private void foundIn(HTMLNode n)
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
crawlerDone
public void crawlerDone()
- Deletes all the temporary files.
- Overrides:
- crawlerDone in class Controller
All Packages Class Hierarchy This Package Previous Next Index