TV-Browser 2.7.5 API

tvbrowser.core.search
Class AbstractSearcher

java.lang.Object
  extended by tvbrowser.core.search.AbstractSearcher
All Implemented Interfaces:
ProgramSearcher
Direct Known Subclasses:
BooleanSearcher, RegexSearcher

public abstract class AbstractSearcher
extends Object
implements ProgramSearcher

An abstract searcher implementation that reduces the checks on String checks.

Author:
Til Schneider, www.murfman.de

Field Summary
protected  boolean mReplaceSpCh
          Indicates if the special characters should be replaced.
 
Constructor Summary
AbstractSearcher()
           
 
Method Summary
 boolean matches(Program prog, ProgramFieldType[] fieldArr)
          Checks whether a field of a program matches to the criteria of this searcher.
protected abstract  boolean matches(String value)
          Checks whether a value matches to the criteria of this searcher.
 Program[] search(ProgramFieldType[] fieldArr, Date startDate, int nrDays, Channel[] channels, boolean sortByStartTime)
          Searches the TV database for programs that match the criteria of this searcher.
 Program[] search(ProgramFieldType[] fieldArr, Date startDate, int nrDays, Channel[] channels, boolean sortByStartTime, ProgressMonitor progress)
          Searches the TV database for programs that match the criteria of this searcher.
 Program[] search(ProgramFieldType[] fieldArr, Date startDate, int nrDays, Channel[] channels, boolean sortByStartTime, ProgressMonitor progress, DefaultListModel listModel)
          Searches the TV database for programs that match the criteria of this searcher.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mReplaceSpCh

protected boolean mReplaceSpCh
Indicates if the special characters should be replaced.

Constructor Detail

AbstractSearcher

public AbstractSearcher()
Method Detail

matches

public boolean matches(Program prog,
                       ProgramFieldType[] fieldArr)
Checks whether a field of a program matches to the criteria of this searcher.

Specified by:
matches in interface ProgramSearcher
Parameters:
prog - The program to check.
fieldArr - The fields to search in.
Returns:
Whether at least one field of the program matches.

search

public Program[] search(ProgramFieldType[] fieldArr,
                        Date startDate,
                        int nrDays,
                        Channel[] channels,
                        boolean sortByStartTime,
                        ProgressMonitor progress)
Searches the TV database for programs that match the criteria of this searcher.

Specified by:
search in interface ProgramSearcher
Parameters:
fieldArr - The fields to search in
startDate - The date to start the search.
nrDays - The number of days to include after the start date. If negative every day get's searched (from yesterday to 4 weeks into the future)
channels - The channels to search in.
sortByStartTime - Should the results be sorted by the start time? If not, the results will be grouped by date and channel and the search will be faster.
progress - progress monitor for monitoring the status of the search
Returns:
The matching programs.

search

public Program[] search(ProgramFieldType[] fieldArr,
                        Date startDate,
                        int nrDays,
                        Channel[] channels,
                        boolean sortByStartTime,
                        ProgressMonitor progress,
                        DefaultListModel listModel)
Searches the TV database for programs that match the criteria of this searcher.

Specified by:
search in interface ProgramSearcher
Parameters:
fieldArr - The fields to search in
startDate - The date to start the search.
nrDays - The number of days to include after the start date. If negative every day get's searched (from yesterday to 4 weeks into the future)
channels - The channels to search in.
sortByStartTime - Should the results be sorted by the start time? If not, the results will be grouped by date and channel and the search will be faster.
progress - progress monitor for monitoring the status of the search
listModel - The list model the found programs should be stored in.
Returns:
The matching programs.

search

public Program[] search(ProgramFieldType[] fieldArr,
                        Date startDate,
                        int nrDays,
                        Channel[] channels,
                        boolean sortByStartTime)
Searches the TV database for programs that match the criteria of this searcher.

Specified by:
search in interface ProgramSearcher
Parameters:
fieldArr - The fields to search in
startDate - The date to start the search.
nrDays - The number of days to include after the start date. If negative every day get's searched (from yesterday to 4 weeks into the future)
channels - The channels to search in.
sortByStartTime - Should the results be sorted by the start time? If not, the results will be grouped by date and channel and the search will be faster.
Returns:
The matching programs.

matches

protected abstract boolean matches(String value)
Checks whether a value matches to the criteria of this searcher.

Parameters:
value - The value to check
Returns:
Whether the value matches.

TV-Browser 2.7.5 API

TV-Browser 2.7.5, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)