FileDocCategorySizeDatePackage
SpanNotBuilder.javaAPI DocApache Lucene 1.91478Mon Feb 27 11:12:20 GMT 2006org.apache.lucene.xmlparser.builders

SpanNotBuilder

public class SpanNotBuilder extends SpanBuilderBase

Fields Summary
SpanQueryBuilder
factory
Constructors Summary
public SpanNotBuilder(SpanQueryBuilder factory)

param
factory

        super();
        this.factory = factory;
    
Methods Summary
public org.apache.lucene.search.spans.SpanQuerygetSpanQuery(org.w3c.dom.Element e)

	    Element includeElem=DOMUtils.getChildByTagName(e,"Include");
	    if(includeElem!=null)
		{
	        includeElem=DOMUtils.getFirstChildElement(includeElem);
		}
	    if(includeElem==null)
	    {
			throw new ParserException("SpanNotQuery missing Include child Element");	        
	    }
	    Element excludeElem=DOMUtils.getChildByTagName(e,"Exclude");
	    if(excludeElem!=null)
		{
	        excludeElem=DOMUtils.getFirstChildElement(excludeElem);
		}
	    if(excludeElem==null)
	    {
			throw new ParserException("SpanNotQuery missing Exclude child Element");	        
	    }
	    SpanQuery include=factory.getSpanQuery(includeElem);
	    SpanQuery exclude=factory.getSpanQuery(excludeElem);
	    
		SpanNotQuery snq = new SpanNotQuery(include,exclude);
		
		snq.setBoost(DOMUtils.getAttribute(e,"boost",1.0f));
		return snq;