TV-Browser 2.7.5 API

util.ui
Class SearchFormSettings

java.lang.Object
  extended by util.ui.SearchFormSettings

public class SearchFormSettings
extends Object

Settings for the SearchForm

Author:
Til Schneider, www.murfman.de
See Also:
SearchForm

Field Summary
static int MATCH_EXACTLY
          Deprecated. Since 1.1. Use PluginManager.SEARCHER_TYPE_EXACTLY instead.
static int MATCH_KEYWORD
          Deprecated. Since 1.1. Use PluginManager.SEARCHER_TYPE_KEYWORD instead.
static int MATCH_REGULAR_EXPRESSION
          Deprecated. Since 1.1. Use PluginManager.SEARCHER_TYPE_REGULAR_EXPRESSION instead.
static int SEARCH_IN_ALL
          Specifies, that all fields should be searched.
static int SEARCH_IN_TITLE
          Specifies, that only titles should be searched.
static int SEARCH_IN_USER_DEFINED
          Specifies, that a user-defined set of fields should be searched.
 
Constructor Summary
SearchFormSettings(ObjectInputStream in)
          Loads a SearchFormSettings instance from a stream.
SearchFormSettings(String searchText)
          Creates a new SearchFormSettings instance.
 
Method Summary
 ProgramSearcher createSearcher()
          Creates a searcher from these settings
 ProgramSearcher createSearcher(String text)
          Creates a searcher from this settings
 boolean getCaseSensitive()
          Gets whether to search case sensitive.
 Channel[] getChannels()
          Get the Channels to search on This returns null when all channels should be searched
 ProgramFieldType[] getFieldTypes()
          Gets the field types to search for.
 int getMatch()
          Deprecated. Since 1.1. Use getSearcherType() instead.
 int getNrDays()
          Gets the number of days If this value is negative, it searches all data (including yesterday)
 int getSearcherType()
          Gets the searcher type to be used.
 int getSearchIn()
          Gets where to search.
 String getSearchText()
          Gets the search text.
 String getSearchTextAsRegex()
          Deprecated. Since 1.1. Use createSearcher() instead.
 ProgramFieldType[] getUserDefinedFieldTypes()
          Gets the field types defined by the user.
 void setCaseSensitive(boolean caseSensitive)
          Sets whether to search case sensitive.
 void setChannels(Channel[] channel)
           
 void setMatch(int match)
          Deprecated. Since 1.1. Use getSearcherType() instead.
 void setNrDays(int nr)
          Sets the number of days If this value is negative, it searches all data (including yesterday)
 void setSearcherType(int searcherType)
          Sets the searcher type to be used.
 void setSearchIn(int searchIn)
          Sets where to search.
 void setSearchText(String searchText)
          Sets the search text.
 void setUserDefinedFieldTypes(ProgramFieldType[] typeArr)
          Sets the user-defined field types to search for.
 String toString()
          Gets the search text.
 void writeData(ObjectOutputStream out)
          Writes the settings into a stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MATCH_EXACTLY

public static final int MATCH_EXACTLY
Deprecated. Since 1.1. Use PluginManager.SEARCHER_TYPE_EXACTLY instead.
Specifies, that the search term has to match exactly.

See Also:
Constant Field Values

MATCH_KEYWORD

public static final int MATCH_KEYWORD
Deprecated. Since 1.1. Use PluginManager.SEARCHER_TYPE_KEYWORD instead.
Specifies, that the search term is a keyword (= substring).

See Also:
Constant Field Values

MATCH_REGULAR_EXPRESSION

public static final int MATCH_REGULAR_EXPRESSION
Deprecated. Since 1.1. Use PluginManager.SEARCHER_TYPE_REGULAR_EXPRESSION instead.
Specifies, that the search term is a regular expression.

See Also:
Constant Field Values

SEARCH_IN_TITLE

public static final int SEARCH_IN_TITLE
Specifies, that only titles should be searched.

See Also:
Constant Field Values

SEARCH_IN_ALL

public static final int SEARCH_IN_ALL
Specifies, that all fields should be searched.

See Also:
Constant Field Values

SEARCH_IN_USER_DEFINED

public static final int SEARCH_IN_USER_DEFINED
Specifies, that a user-defined set of fields should be searched.

See Also:
setUserDefinedFieldTypes(ProgramFieldType[]), Constant Field Values
Constructor Detail

SearchFormSettings

public SearchFormSettings(String searchText)
Creates a new SearchFormSettings instance.

Parameters:
searchText - The search text

SearchFormSettings

public SearchFormSettings(ObjectInputStream in)
                   throws IOException,
                          ClassNotFoundException
Loads a SearchFormSettings instance from a stream.

Parameters:
in - The stream to read from
Throws:
IOException - If reading failed
ClassNotFoundException - If the read data has the wrong format
See Also:
writeData(ObjectOutputStream)
Method Detail

writeData

public void writeData(ObjectOutputStream out)
               throws IOException
Writes the settings into a stream

Parameters:
out - The stream to write to
Throws:
IOException - If writing failed
See Also:
SearchFormSettings(ObjectInputStream)

toString

public String toString()
Gets the search text.

Overrides:
toString in class Object
Returns:
The search text

getSearchText

public String getSearchText()
Gets the search text.

Returns:
The search text

setSearchText

public void setSearchText(String searchText)
Sets the search text.

Parameters:
searchText - The search text

createSearcher

public ProgramSearcher createSearcher()
                               throws TvBrowserException
Creates a searcher from these settings

Returns:
A searcher that satisfies these settings.
Throws:
TvBrowserException - If creating the searcher failed.

createSearcher

public ProgramSearcher createSearcher(String text)
                               throws TvBrowserException
Creates a searcher from this settings

Parameters:
text - Search for this Text
Returns:
A searcher that satisfies these settings.
Throws:
TvBrowserException - If creating the searcher failed.

getSearchTextAsRegex

public String getSearchTextAsRegex()
Deprecated. Since 1.1. Use createSearcher() instead.

Gets the search text as regular expression.

Returns:
The search text as regular expression.

getFieldTypes

public ProgramFieldType[] getFieldTypes()
Gets the field types to search for.

Returns:
The field types to search for.

getUserDefinedFieldTypes

public ProgramFieldType[] getUserDefinedFieldTypes()
Gets the field types defined by the user.

Returns:
The field types defined by the user.

setUserDefinedFieldTypes

public void setUserDefinedFieldTypes(ProgramFieldType[] typeArr)
Sets the user-defined field types to search for.

Parameters:
typeArr - The field types to search for

getSearchIn

public int getSearchIn()
Gets where to search. Either SEARCH_IN_TITLE, SEARCH_IN_ALL or SEARCH_IN_USER_DEFINED.

Returns:
Where to search

setSearchIn

public void setSearchIn(int searchIn)
Sets where to search. Must be either SEARCH_IN_TITLE, SEARCH_IN_ALL or SEARCH_IN_USER_DEFINED.

Parameters:
searchIn - Where to search

getSearcherType

public int getSearcherType()
Gets the searcher type to be used.

Returns:
The searcher type to be used.
See Also:
PluginManager.createProgramSearcher(int, String, boolean)

setSearcherType

public void setSearcherType(int searcherType)
Sets the searcher type to be used.

Parameters:
searcherType - The searcher type to be used.
See Also:
PluginManager.createProgramSearcher(int, String, boolean)

getMatch

public int getMatch()
Deprecated. Since 1.1. Use getSearcherType() instead.

Gets what how the search text has to match.

Returns:
How the search text has to match.

setMatch

public void setMatch(int match)
Deprecated. Since 1.1. Use getSearcherType() instead.

Sets what how the search text has to match.

Parameters:
match - How the search text has to match.

getCaseSensitive

public boolean getCaseSensitive()
Gets whether to search case sensitive.

Returns:
Whether to search case sensitive

setCaseSensitive

public void setCaseSensitive(boolean caseSensitive)
Sets whether to search case sensitive.

Parameters:
caseSensitive - Whether to search case sensitive

getNrDays

public int getNrDays()
Gets the number of days If this value is negative, it searches all data (including yesterday)

Returns:
number of days to search

setNrDays

public void setNrDays(int nr)
Sets the number of days If this value is negative, it searches all data (including yesterday)

Parameters:
nr - number of days to search

getChannels

public Channel[] getChannels()
Get the Channels to search on This returns null when all channels should be searched

Returns:
channels to search on

setChannels

public void setChannels(Channel[] channel)

TV-Browser 2.7.5 API

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