1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /*
  17. * $Id: ExpressionNode.java,v 1.3 2004/02/17 04:30:02 minchau Exp $
  18. */
  19. package com.sun.org.apache.xpath.internal;
  20. import javax.xml.transform.SourceLocator;
  21. /**
  22. * A class that implements this interface can construct expressions,
  23. * give information about child and parent expressions,
  24. * and give the originating source information. A class that implements
  25. * this interface does not lay any claim to being directly executable.
  26. *
  27. * <p>Note: This interface should not be considered stable. Only exprSetParent
  28. * and exprGetParent can be counted on to work reliably. Work in progress.</p>
  29. */
  30. public interface ExpressionNode extends SourceLocator
  31. {
  32. /** This pair of methods are used to inform the node of its
  33. parent. */
  34. public void exprSetParent(ExpressionNode n);
  35. public ExpressionNode exprGetParent();
  36. /** This method tells the node to add its argument to the node's
  37. list of children. */
  38. public void exprAddChild(ExpressionNode n, int i);
  39. /** This method returns a child node. The children are numbered
  40. from zero, left to right. */
  41. public ExpressionNode exprGetChild(int i);
  42. /** Return the number of children the node has. */
  43. public int exprGetNumChildren();
  44. }