|
Lucene example source code file (QueryNodeProcessorImpl.java)
The Lucene QueryNodeProcessorImpl.java source code
package org.apache.lucene.queryParser.core.processors;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.util.ArrayList;
import java.util.List;
import org.apache.lucene.queryParser.core.QueryNodeException;
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
import org.apache.lucene.queryParser.core.nodes.QueryNode;
/**
* <p>
* This is a default implementation for the {@link QueryNodeProcessor}
* interface, it's an abstract class, so it should be extended by classes that
* want to process a {@link QueryNode} tree.
* </p>
* <p>
* This class process {@link QueryNode}s from left to right in the tree. While
* it's walking down the tree, for every node,
* {@link #preProcessNode(QueryNode)} is invoked. After a node's children are
* processed, {@link #postProcessNode(QueryNode)} is invoked for that node.
* {@link #setChildrenOrder(List)} is invoked before
* {@link #postProcessNode(QueryNode)} only if the node has at least one child,
* in {@link #setChildrenOrder(List)} the implementor might redefine the
* children order or remove any children from the children list.
* </p>
* <p>
* Here is an example about how it process the nodes:
* </p>
*
* <pre>
* a
* / \
* b e
* / \
* c d
* </pre>
*
* Here is the order the methods would be invoked for the tree described above:
*
* <pre>
* preProcessNode( a );
* preProcessNode( b );
* preProcessNode( c );
* postProcessNode( c );
* preProcessNode( d );
* postProcessNode( d );
* setChildrenOrder( bChildrenList );
* postProcessNode( b );
* preProcessNode( e );
* postProcessNode( e );
* setChildrenOrder( aChildrenList );
* postProcessNode( a )
* </pre>
*
* @see org.apache.lucene.queryParser.core.processors.QueryNodeProcessor
*/
public abstract class QueryNodeProcessorImpl implements QueryNodeProcessor {
private ArrayList<ChildrenList> childrenListPool = new ArrayList
Other Lucene examples (source code examples)Here is a short list of links related to this Lucene QueryNodeProcessorImpl.java source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.