Package application.model.search.csearch
Class BruteForceSearch
java.lang.Object
application.model.search.SearchProgram
application.model.search.csearch.BruteForceSearch
public class BruteForceSearch extends SearchProgram
CAViewer's brute force search program - csearch.
TODO (Object Separation)
-
Field Summary
Fields inherited from class application.model.search.SearchProgram
executor, numSearched, searchParameters, searchResults, stop
-
Constructor Summary
Constructors Constructor Description BruteForceSearch(BruteForceSearchParameters parameters)
Constructs the brute force search program with the provided parameters -
Method Summary
Modifier and Type Method Description void
search(int num)
Search for something num timesvoid
searchThreaded(int num, int numThreads)
Performs the search but with multi-threadingboolean
writeToFile(java.io.File file)
Writes the search results to a fileMethods inherited from class application.model.search.SearchProgram
add, add, getNumSearched, getSearchParameters, getSearchResults, terminateSearch
-
Constructor Details
-
BruteForceSearch
Constructs the brute force search program with the provided parameters- Parameters:
parameters
- The parameters of the search program
-
-
Method Details
-
search
public void search(int num)Description copied from class:SearchProgram
Search for something num times- Specified by:
search
in classSearchProgram
- Parameters:
num
- The number of times to search for something
-
searchThreaded
public void searchThreaded(int num, int numThreads)Description copied from class:SearchProgram
Performs the search but with multi-threading- Overrides:
searchThreaded
in classSearchProgram
- Parameters:
num
- The number of times to search for somethingnumThreads
- The number of threads to use in the search
-
writeToFile
public boolean writeToFile(java.io.File file)Description copied from class:SearchProgram
Writes the search results to a file- Specified by:
writeToFile
in classSearchProgram
- Parameters:
file
- The file to write the search results to- Returns:
- Returns true if successful, false if unsuccessful
-