001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.parsers.creole.ast;
016    
017    import com.liferay.portal.parsers.creole.visitor.ASTVisitor;
018    
019    import java.util.ArrayList;
020    import java.util.List;
021    
022    /**
023     * @author Miguel Pastor
024     */
025    public class CollectionNode extends ASTNode {
026    
027            public CollectionNode() {
028            }
029    
030            public CollectionNode(int token) {
031                    super(token);
032            }
033    
034            public CollectionNode(List<ASTNode> astNodes) {
035                    _astNodes = astNodes;
036            }
037    
038            @Override
039            public void accept(ASTVisitor astVisitor) {
040                    astVisitor.visit(this);
041            }
042    
043            public void add(ASTNode astNode) {
044                    _astNodes.add(astNode);
045            }
046    
047            public ASTNode get(int position) {
048                    return _astNodes.get(position);
049            }
050    
051            public List<ASTNode> getASTNodes() {
052                    return _astNodes;
053            }
054    
055            public int size() {
056                    return _astNodes.size();
057            }
058    
059            private List<ASTNode> _astNodes = new ArrayList<ASTNode>();
060    
061    }