net.sourceforge.rssowl.util.search
Class ParsedSearch

java.lang.Object
  extended by net.sourceforge.rssowl.util.search.ParsedSearch

public class ParsedSearch
extends java.lang.Object

The ParsedSearch class takes a SearchDefinition as Input to parse. In case the definition tells to use the Pattern directly as regular expression, the Pattern is not parsed. In the other case, the given Pattern is parsed for the Search-Keywords "AND", "OR" and "NOT", which may be used to specify the Search.
The Result of the parsing are two Lists, one for the must- and one for the must-not include keywords.

Version:
1.2.4
Author:
Benjamin Pasero

Field Summary
private  java.util.ArrayList mustContain
           
private  java.util.ArrayList mustNotContain
           
private  SearchDefinition searchDefinition
           
 
Constructor Summary
private ParsedSearch(SearchDefinition searchDefinition)
          Instantiate a new ParsedSearch.
 
Method Summary
 java.util.ArrayList getMustContain()
          Get the List with must-contain Keywords.
 java.util.ArrayList getMustNotContain()
          Get the List with must-not-contain Keywords.
 SearchDefinition getSearchDefinition()
          Get the Search Defintion.
 boolean isRegExSearch()
          Check wether this search is a plain regular expression search.
static ParsedSearch parseFrom(SearchDefinition searchDefinition)
          Parse the given Search Definition.
private  void setMustContain(java.util.ArrayList mustContain)
          Set the List with must-contain Keywords.
private  void setMustNotContain(java.util.ArrayList mustNotContain)
          Set the List with must-not-contain Keywords.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mustContain

private java.util.ArrayList mustContain

mustNotContain

private java.util.ArrayList mustNotContain

searchDefinition

private SearchDefinition searchDefinition
Constructor Detail

ParsedSearch

private ParsedSearch(SearchDefinition searchDefinition)
Instantiate a new ParsedSearch.

Parameters:
searchDefinition - The Definition of this Search.
Method Detail

parseFrom

public static ParsedSearch parseFrom(SearchDefinition searchDefinition)
Parse the given Search Definition.

Parameters:
searchDefinition - The Definition of this Search.
Returns:
ParsedSearch The parsed Search from the given definition.

getMustContain

public java.util.ArrayList getMustContain()
Get the List with must-contain Keywords.

Returns:
ArrayList A List of regular expressions that must match the NewsItem in the defined Scope.

getMustNotContain

public java.util.ArrayList getMustNotContain()
Get the List with must-not-contain Keywords.

Returns:
ArrayList A List of regular expressions that must not match the NewsItem in the defined Scope.

getSearchDefinition

public SearchDefinition getSearchDefinition()
Get the Search Defintion.

Returns:
SearchDefinition The Definition of this Search.

isRegExSearch

public boolean isRegExSearch()
Check wether this search is a plain regular expression search.

Returns:
TRUE if the Pattern should not be parsed but used as regular expression directly.

setMustContain

private void setMustContain(java.util.ArrayList mustContain)
Set the List with must-contain Keywords.

Parameters:
mustContain - A List of regular expressions that must match the NewsItem in the defined Scope.

setMustNotContain

private void setMustNotContain(java.util.ArrayList mustNotContain)
Set the List with must-not-contain Keywords.

Parameters:
mustNotContain - A List of regular expressions that must not match the NewsItem in the defined Scope.


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo