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.*;

Author(s):
Yana Panchenko
 
 @XmlType(propOrder = {"targets""categories""srcIds""tokIds"})
 public class MatchedItemStored implements MatchedItem {
 
     public static final String XML_NAME = "item";
     public static final String XML_ATTRIBUTE_SOURCE_IDs = "srcIDs";
     public static final String XML_ELEMENT_TARGET = "target";
     public static final String XML_ELEMENT_CATEGORY = "category";
     @XmlAttribute(name = ., required = true)
     protected String[] tokIds;
     protected String[] srcIds;
     @XmlElement(name = )
     protected List<MatchedItemTargettargets = new ArrayList<MatchedItemTarget>();
     @XmlElement(name = )
 
     MatchedItemStored() {
     }
 
     MatchedItemStored(String[] tokIdsString[] srcIdsMap<StringStringtargetsMapMap<StringStringcategoriesMap) {
         this. = tokIds;
         if (srcIds.length > 0) {
             this. = srcIds;
         }
         for (String name : targetsMap.keySet()) {
             .add(new MatchedItemTarget(nametargetsMap.get(name)));
         }
         for (String name : categoriesMap.keySet()) {
             .add(new MatchedItemCategory(namecategoriesMap.get(name)));
         }
     }
 
     @Override
     public String[] getOriginCorpusTokenIds() {
         return ;
     }
 
     @Override
     public Set<StringgetTargetNames() {
         Set<Stringnames = new HashSet<String>();
         for (MatchedItemTarget target : this.) {
             names.add(target.name);
         }
         return names;
     }
 
     @Override
     public String getTargetValue(String targetName) {
         for (MatchedItemTarget target : this.) {
             if (targetName.equals(target.name)) {
                 return target.value;
             }
         }
         return null;
     }
 
     @Override
     public Set<StringgetCategoriesNames() {
         Set<Stringnames = new HashSet<String>();
         for (MatchedItemCategory cat : this.) {
             names.add(cat.name);
         }
         return names;
     }
 
     @Override
    public String getCategoryValue(String categoryName) {
        for (MatchedItemCategory cat : this.) {
            if (categoryName.equals(cat.name)) {
                return cat.value;
            }
        }
        return null;
    }
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(Arrays.toString());
        if ( != null) {
            sb.append(" ");
            sb.append(Arrays.toString());
        }
        if (!.isEmpty()) {
            sb.append(" ");
            sb.append();
        }
        if (!.isEmpty()) {
            sb.append(" ");
            sb.append();
        }
        return sb.toString();
    }
New to GrepCode? Check out our FAQ X