The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
/* 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.
 */

parcel Lucy;

/** Leaf node in a tree created by QueryParser.
 *
 * LeafQuery objects serve as leaf nodes in the tree structure generated by
 * L<QueryParser|Lucy::Search::QueryParser>'s Tree() method.
 * Ultimately, they must be transformed, typically into either
 * L<TermQuery|Lucy::Search::TermQuery> or
 * L<PhraseQuery|Lucy::Search::PhraseQuery> objects, as attempting to
 * search a LeafQuery causes an error.
 */
public class Lucy::Search::LeafQuery inherits Lucy::Search::Query {

    String *field;
    String *text;

    inert incremented LeafQuery*
    new(String *field = NULL, String *text);

    /**
     * @param field Optional field name.
     * @param text Raw query text.
     */
    public inert LeafQuery*
    init(LeafQuery *self, String *field = NULL, String *text);

    /** Accessor for object's <code>field</code> attribute.
     */
    public nullable String*
    Get_Field(LeafQuery *self);

    /** Accessor for object's <code>text</code> attribute.
     */
    public String*
    Get_Text(LeafQuery *self);

    public bool
    Equals(LeafQuery *self, Obj *other);

    public incremented String*
    To_String(LeafQuery *self);

    public void
    Serialize(LeafQuery *self, OutStream *outstream);

    public incremented LeafQuery*
    Deserialize(decremented LeafQuery *self, InStream *instream);

    public incremented Obj*
    Dump(LeafQuery *self);

    public incremented Obj*
    Load(LeafQuery *self, Obj *dump);

    /** Throws an error.
     */
    public incremented Compiler*
    Make_Compiler(LeafQuery *self, Searcher *searcher, float boost,
                  bool subordinate = false);

    public void
    Destroy(LeafQuery *self);
}