FileDocCategorySizeDatePackage
RegexQuery.javaAPI DocApache Lucene 1.92397Mon Feb 27 11:12:26 GMT 2006org.apache.lucene.search.regex

RegexQuery

public class RegexQuery extends MultiTermQuery implements RegexQueryCapable
Implements the regular expression term search query. The expressions supported depend on the regular expression implementation used by way of the {@link RegexCapabilities} interface.
see
RegexTermEnum

Fields Summary
private RegexCapabilities
regexImpl
Constructors Summary
public RegexQuery(Term term)
Constructs a query for terms matching term.


          
     
    super(term);
  
Methods Summary
public booleanequals(java.lang.Object o)

    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    if (!super.equals(o)) return false;

    final RegexQuery that = (RegexQuery) o;

    return regexImpl.equals(that.regexImpl);
  
protected org.apache.lucene.search.FilteredTermEnumgetEnum(org.apache.lucene.index.IndexReader reader)

    Term term = new Term(getTerm().field(), getTerm().text());
    return new RegexTermEnum(reader, term, regexImpl);
  
public RegexCapabilitiesgetRegexImplementation()

return
The implementation used by this instance.

    return regexImpl;
  
public inthashCode()

    int result = super.hashCode();
    result = 29 * result + regexImpl.hashCode();
    return result;
  
public voidsetRegexImplementation(RegexCapabilities impl)
Defines which {@link RegexCapabilities} implementation is used by this instance.

param
impl

    this.regexImpl = impl;