Package org.basex.util.ft
Class FTBitapSearch
java.lang.Object
org.basex.util.ft.FTBitapSearch
Generalized search algorithm based on the Bitap string matching algorithm. The implementation is
based on the implementation in Wikipedia, but uses
BitSet for fast bit operation. This
version works with a set of needles and each one of it can be matched in the haystack.- Author:
- BaseX Team 2005-21, BSD License, Dimitar Popov
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceToken comparator. -
Constructor Summary
ConstructorsConstructorDescriptionFTBitapSearch(FTIterator iter, FTTokens tokens, FTBitapSearch.TokenComparator cmp) Constructor. -
Method Summary
-
Constructor Details
-
FTBitapSearch
Constructor.- Parameters:
iter- iterator over the set of elements being searched ("haystack")tokens- a list of "needles" (a needle is an array of elements being searched for)cmp- comparator for comparing two elements for equality
-
-
Method Details
-
hasNext
Is there one more match?- Returns:
trueif yes- Throws:
QueryException- if an error occurs during search
-
next
Position in the haystack of the next match.- Returns:
- start position of the match; first position is 0
- Throws:
QueryException- if an error occurs during search
-