Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
wlfxb - a library for creating and processing of TCF data streams. Copyright (C) Yana Panchenko. This file is part of wlfxb. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 
 package eu.clarin.weblicht.wlfxb.tc.xb;
 
 import java.util.List;

Author(s):
Yana Panchenko
 
 public class ConstituentStored implements Constituent {
 
     public static final String XML_NAME = "constituent";
     public static final String XML_ATTRIBUTE_CATEGORY = "cat";
     public static final String ID_PREFIX = "c_";
     @XmlAttribute(name = .)
     protected String constituentId;
     @XmlAttribute(name = , required = true)
     protected String category;
     @XmlAttribute(name = "edge")
     protected String edge;
     protected String[] tokRefs;
     protected List<ConstituentStoredchildren = new ArrayList<ConstituentStored>();
 
     @Override
     public boolean isTerminal() {
         return .isEmpty();
     }
 
     @Override
     public boolean isEmptyTerminal() {
         if (isTerminal() && ( == null || . == 0)) {
             return true;
         } else {
             return false;
         }
     }
 
     @Override
     public Constituent[] getChildren() {
         // in order to not let user to add children to the list
         if (.isEmpty()) {
             return null;
         } else {
             Constituent[] childrenAsArray = new Constituent[.size()];
             return .toArray(childrenAsArray);
         }
     }
 
     @Override
         ConstituentReference[] crefstemp = new ConstituentReference[.size()];
         return .toArray(crefstemp);
     }
 
     @Override
     public String getCategory() {
         return ;
     }
 
     @Override
     public String getEdge() {
         return ;
     }
 
     @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        if ( != null) {
            sb.append();
            sb.append(" -> ");
        }
        sb.append();
        sb.append(" ");
        if ( != null) {
            sb.append();
            sb.append(" ");
        }
        if (!.isEmpty()) {
            sb.append(.toString());
            sb.append(" ");
        }
        if ( != null) {
            sb.append(Arrays.toString());
        } else {
            sb.append("( ");
            for (Constituent c : ) {
                sb.append(c.toString());
                sb.append(" ");
            }
            sb.append(")");
        }
        return sb.toString();
    }
New to GrepCode? Check out our FAQ X