Bibi
19 Oct 2005 21:04

ujap.bibi
Class Searcher

java.lang.Object
  extended byujap.bibi.Searcher
All Implemented Interfaces:
orbital.logic.functor.Functor, orbital.logic.functor.Predicate

public class Searcher
extends Object
implements orbital.logic.functor.Predicate

start using the search method. remember the result searcher object, and get the resulting collection with its getResult() method, and find out the query string (format: "Search: XYZ in fields: ABC") with its getQuery() method.

Author:
Ute Platzer

Nested Class Summary
 
Nested classes inherited from class orbital.logic.functor.Predicate
orbital.logic.functor.Predicate.Composite
 
Nested classes inherited from class orbital.logic.functor.Functor
orbital.logic.functor.Functor.Specification
 
Field Summary
private  boolean caseInsensitive
          if search is case-sensitive or not
private static boolean doSearch
          set by the search dialog to indicate whether user cancelled search
private  String field
          the name of the field to be searched
private static String[] fieldNames
           
private static String filename
          may never be null
private  String query
           
private static ResourceBundle resources
           
private  Collection result
           
private  boolean searchAllFields
          whether all fields or only specific fields of the entry will be searched
private  String searchText
          the text to be found
 
Fields inherited from interface orbital.logic.functor.Predicate
callTypeDeclaration
 
Constructor Summary
Searcher()
           
 
Method Summary
 boolean apply(Object o)
          check whether the given object, an instance of Entry, fulfills the search criteria
 String getQuery()
           
 Collection getResult()
           
private static void init()
           
static Searcher search(Collection c)
          search through a collection of Entries and return a Collection of entries that fulfill the criteria.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface orbital.logic.functor.Predicate
 
Methods inherited from interface orbital.logic.functor.Functor
equals, hashCode, toString
 

Field Detail

resources

private static final ResourceBundle resources

searchAllFields

private boolean searchAllFields
whether all fields or only specific fields of the entry will be searched


field

private String field
the name of the field to be searched


searchText

private String searchText
the text to be found


caseInsensitive

private boolean caseInsensitive
if search is case-sensitive or not


doSearch

private static boolean doSearch
set by the search dialog to indicate whether user cancelled search


query

private String query

result

private Collection result

filename

private static String filename
may never be null


fieldNames

private static String[] fieldNames
Constructor Detail

Searcher

public Searcher()
Method Detail

search

public static Searcher search(Collection c)
search through a collection of Entries and return a Collection of entries that fulfill the criteria. may return null if search was cancelled


getResult

public Collection getResult()

getQuery

public String getQuery()

apply

public boolean apply(Object o)
check whether the given object, an instance of Entry, fulfills the search criteria

Specified by:
apply in interface orbital.logic.functor.Predicate
Returns:
true if the entry contains the search text, false if the object is not an entry or does not contain the text.

init

private static void init()

Bibi
19 Oct 2005 21:04

Copyright ? 2002-2005 Ute Platzer. All Rights Reserved.