comirva.config
Class PageCountsRetrieverConfig

java.lang.Object
  extended by comirva.config.PageCountsRetrieverConfig
All Implemented Interfaces:
AnySearchConfig

public class PageCountsRetrieverConfig
extends Object
implements AnySearchConfig

This class represents a configuration for a PageCountsRetrieval It is used to pass a configuration to the PageCountsRetriever-instance.


Constructor Summary
PageCountsRetrieverConfig(String searchEngineURL, int numberOfRetries, int intervalBetweenRetries, String additionalKeywords, boolean additionalKeywordsAfterSearchString, boolean queryForAllPairs, boolean isQuoteSearchTerms)
          Creates a new instance of an PageCountsRetriever-Configuration.
 
Method Summary
 String getAdditionalKeywords()
          Returns the additional keywords to be added to the search string.
 boolean getAdditionalKeywordsAfterSearchString()
          Returns whether additional keywords are to be placed after the search string or before.
 int getFirstRequestedPageNumber()
          Returns the number of the first requested page (usually 0)
 int getIntervalBetweenRetries()
          Returns the interval between two retries in case of failure (in seconds).
 int getNumberOfRequestedPages()
          Returns the number of requested web pages per web crawl.
 int getNumberOfRetries()
          Returns the number of retries in case of failure to raise a search query.
 boolean getQueryForAllPairs()
          Returns whether queries should be raised for all pairs of the strings in the meta-data vector or the selected meta-data vector is processed sequentially as a list that is queried.
 String getSearchEngineURL()
          Returns the URL of the search engine to be used.
 boolean isQuoteSearchTerms()
          Returns whether the search terms should be automatically quoted (i.e., phrase search to be used).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageCountsRetrieverConfig

public PageCountsRetrieverConfig(String searchEngineURL,
                                 int numberOfRetries,
                                 int intervalBetweenRetries,
                                 String additionalKeywords,
                                 boolean additionalKeywordsAfterSearchString,
                                 boolean queryForAllPairs,
                                 boolean isQuoteSearchTerms)
Creates a new instance of an PageCountsRetriever-Configuration.

Parameters:
searchEngineURL - a String containing the URL of the search engine
numberOfRetries - the number of retries in case of failure
intervalBetweenRetries - the interval between two retries (in seconds)
additionalKeywords - additional keywords in the query
additionalKeywordsAfterSearchString - whether the additional keywords are to be placed after (or before) the search string
isQuoteSearchTerms - should the search terms automatically be quoted (phrase search)
Method Detail

getSearchEngineURL

public String getSearchEngineURL()
Returns the URL of the search engine to be used.

Returns:
a String containing the URL of the search engine.

getNumberOfRetries

public int getNumberOfRetries()
Returns the number of retries in case of failure to raise a search query.

Specified by:
getNumberOfRetries in interface AnySearchConfig
Returns:
the number of retries

getIntervalBetweenRetries

public int getIntervalBetweenRetries()
Returns the interval between two retries in case of failure (in seconds).

Specified by:
getIntervalBetweenRetries in interface AnySearchConfig
Returns:
the interval between two retries

getFirstRequestedPageNumber

public int getFirstRequestedPageNumber()
Returns the number of the first requested page (usually 0)

Specified by:
getFirstRequestedPageNumber in interface AnySearchConfig
Returns:
0 since the value of this parameter does not matter in page count retrieval

getNumberOfRequestedPages

public int getNumberOfRequestedPages()
Returns the number of requested web pages per web crawl.

Specified by:
getNumberOfRequestedPages in interface AnySearchConfig
Returns:
1 since we are only interested in the page counts

getAdditionalKeywords

public String getAdditionalKeywords()
Returns the additional keywords to be added to the search string.

Returns:
a String containing the additional keywords

getAdditionalKeywordsAfterSearchString

public boolean getAdditionalKeywordsAfterSearchString()
Returns whether additional keywords are to be placed after the search string or before.

Returns:
true if additional keywords should be placed after the search string, false if they are placed before the search string

getQueryForAllPairs

public boolean getQueryForAllPairs()
Returns whether queries should be raised for all pairs of the strings in the meta-data vector or the selected meta-data vector is processed sequentially as a list that is queried.

Returns:
true if all pairwise combinations of the elements in the selected meta-data vector should be queried, false if each item in the meta-data vector is queried independently of the others

isQuoteSearchTerms

public boolean isQuoteSearchTerms()
Returns whether the search terms should be automatically quoted (i.e., phrase search to be used).

Returns:
true if all search terms are automatically quoted false if search will be conducted using the search terms as they are