001    // This file is part of AceWiki.
002    // Copyright 2008-2012, AceWiki developers.
003    // 
004    // AceWiki is free software: you can redistribute it and/or modify it under the terms of the GNU
005    // Lesser General Public License as published by the Free Software Foundation, either version 3 of
006    // the License, or (at your option) any later version.
007    // 
008    // AceWiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
009    // even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
010    // Lesser General Public License for more details.
011    // 
012    // You should have received a copy of the GNU Lesser General Public License along with AceWiki. If
013    // not, see http://www.gnu.org/licenses/.
014    
015    package ch.uzh.ifi.attempto.chartparser;
016    
017    /**
018     * This class stands for a nonterminal category. This class also includes special categories
019     * like references, scope openers, and position operators.
020     * 
021     * @author Tobias Kuhn
022     */
023    public class Nonterminal extends Category {
024            
025            /**
026             * Creates a new nonterminal category.
027             */
028            protected Nonterminal() {
029            }
030    
031            /**
032             * Creates a new nonterminal category.
033             * 
034             * @param name The name of the category.
035             */
036            public Nonterminal(String name) {
037                    this.name = name;
038                    featureMap = new FeatureMap();
039            }
040            
041            /**
042             * Sets the feature map of this category.
043             * 
044             * @param featureMap The new feature map.
045             */
046            public void setFeatureMap(FeatureMap featureMap) {
047                    this.featureMap = featureMap;
048            }
049            
050            protected String getType() {
051                    return "nonterm";
052            }
053            
054            public String toString() {
055                    return name + featureMap.toString();
056            }
057    
058    }