001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }