< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/SyntaxTreeNode.java

Print this page


   1 /*
   2  * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.

   3  */
   4 /*
   5  * Licensed to the Apache Software Foundation (ASF) under one or more
   6  * contributor license agreements.  See the NOTICE file distributed with
   7  * this work for additional information regarding copyright ownership.
   8  * The ASF licenses this file to You under the Apache License, Version 2.0
   9  * (the "License"); you may not use this file except in compliance with
  10  * the License.  You may obtain a copy of the License at
  11  *
  12  *     http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 package com.sun.org.apache.xalan.internal.xsltc.compiler;
  22 


 839      */
 840     protected final Iterator<SyntaxTreeNode> elements() {
 841         return _contents.iterator();
 842     }
 843 
 844     /**
 845      * Returns a child node at a given position.
 846      * @param pos The child node's position.
 847      * @return The child node.
 848      */
 849     protected final SyntaxTreeNode elementAt(int pos) {
 850         return _contents.get(pos);
 851     }
 852 
 853     /**
 854      * Returns this element's last child
 855      * @return The child node.
 856      */
 857     protected final SyntaxTreeNode lastChild() {
 858         if (_contents.isEmpty()) return null;
 859         return (SyntaxTreeNode)_contents.get(_contents.size() - 1);
 860     }
 861 
 862     /**
 863      * Displays the contents of this syntax tree node (to stdout).
 864      * This method is intended for debugging _only_, and should be overridden
 865      * by all syntax tree node implementations.
 866      * @param indent Indentation level for syntax tree levels.
 867      */
 868     public void display(int indent) {
 869         displayContents(indent);
 870     }
 871 
 872     /**
 873      * Displays the contents of this syntax tree node (to stdout).
 874      * This method is intended for debugging _only_ !!!
 875      * @param indent Indentation level for syntax tree levels.
 876      */
 877     protected void displayContents(int indent) {
 878         for (SyntaxTreeNode item : _contents) {
 879             item.display(indent);


   1 /*
   2  * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * @LastModified: Nov 2017
   4  */
   5 /*
   6  * Licensed to the Apache Software Foundation (ASF) under one or more
   7  * contributor license agreements.  See the NOTICE file distributed with
   8  * this work for additional information regarding copyright ownership.
   9  * The ASF licenses this file to You under the Apache License, Version 2.0
  10  * (the "License"); you may not use this file except in compliance with
  11  * the License.  You may obtain a copy of the License at
  12  *
  13  *     http://www.apache.org/licenses/LICENSE-2.0
  14  *
  15  * Unless required by applicable law or agreed to in writing, software
  16  * distributed under the License is distributed on an "AS IS" BASIS,
  17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18  * See the License for the specific language governing permissions and
  19  * limitations under the License.
  20  */
  21 
  22 package com.sun.org.apache.xalan.internal.xsltc.compiler;
  23 


 840      */
 841     protected final Iterator<SyntaxTreeNode> elements() {
 842         return _contents.iterator();
 843     }
 844 
 845     /**
 846      * Returns a child node at a given position.
 847      * @param pos The child node's position.
 848      * @return The child node.
 849      */
 850     protected final SyntaxTreeNode elementAt(int pos) {
 851         return _contents.get(pos);
 852     }
 853 
 854     /**
 855      * Returns this element's last child
 856      * @return The child node.
 857      */
 858     protected final SyntaxTreeNode lastChild() {
 859         if (_contents.isEmpty()) return null;
 860         return _contents.get(_contents.size() - 1);
 861     }
 862 
 863     /**
 864      * Displays the contents of this syntax tree node (to stdout).
 865      * This method is intended for debugging _only_, and should be overridden
 866      * by all syntax tree node implementations.
 867      * @param indent Indentation level for syntax tree levels.
 868      */
 869     public void display(int indent) {
 870         displayContents(indent);
 871     }
 872 
 873     /**
 874      * Displays the contents of this syntax tree node (to stdout).
 875      * This method is intended for debugging _only_ !!!
 876      * @param indent Indentation level for syntax tree levels.
 877      */
 878     protected void displayContents(int indent) {
 879         for (SyntaxTreeNode item : _contents) {
 880             item.display(indent);


< prev index next >