001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one
003     * or more contributor license agreements. See the NOTICE file
004     * distributed with this work for additional information
005     * regarding copyright ownership. The ASF licenses this file
006     * to you under the Apache License, Version 2.0 (the  "License");
007     * you may not use this file except in compliance with the License.
008     * You may obtain a copy of the License at
009     *
010     *     http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing, software
013     * distributed under the License is distributed on an "AS IS" BASIS,
014     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015     * See the License for the specific language governing permissions and
016     * limitations under the License.
017     */
018    /*
019     * $Id: ExpressionNode.java 468655 2006-10-28 07:12:06Z minchau $
020     */
021    package org.apache.xpath;
022    
023    import javax.xml.transform.SourceLocator;
024    
025    /**
026     * A class that implements this interface can construct expressions, 
027     * give information about child and parent expressions,
028     * and give the originating source information.  A class that implements 
029     * this interface does not lay any claim to being directly executable.
030     * 
031     * <p>Note: This interface should not be considered stable.  Only exprSetParent 
032     * and exprGetParent can be counted on to work reliably.  Work in progress.</p>
033     */
034    public interface ExpressionNode extends SourceLocator
035    {
036      /** This pair of methods are used to inform the node of its
037        parent. */
038      public void exprSetParent(ExpressionNode n);
039      public ExpressionNode exprGetParent();
040    
041      /** This method tells the node to add its argument to the node's
042        list of children.  */
043      public void exprAddChild(ExpressionNode n, int i);
044    
045      /** This method returns a child node.  The children are numbered
046         from zero, left to right. */
047      public ExpressionNode exprGetChild(int i);
048    
049      /** Return the number of children the node has. */
050      public int exprGetNumChildren();
051    }
052