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) University of Tübingen. 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
 
 @SuppressWarnings("deprecation")
 public class RelationsLayerStored extends TextCorpusLayerStoredAbstract implements RelationsLayer {
 
     public static final String XML_NAME = "relations";
     @XmlAttribute(name = ., required = true)
     private String type;
     @XmlElement(name = .)
     private List<RelationStoredrelations = new ArrayList<RelationStored>();
 
     protected RelationsLayerStored() {
     }
 
     protected RelationsLayerStored(String type) {
         this. = type;
     }
 
     protected RelationsLayerStored(TextCorpusLayersConnector connector) {
         this. = connector;
     }
 
     protected void setLayersConnector(TextCorpusLayersConnector connector) {
         this. = connector;
         for (RelationStored rel : ) {
             for (String tokRef : rel.tokRefs) {
                 connector.token2ItsRelation.put(connector.tokenId2ItsToken.get(tokRef), rel);
             }
         }
     }
 
     @Override
     public boolean isEmpty() {
         return .isEmpty();
     }
 
     @Override
     public int size() {
         return .size();
     }
 
     @Override
     public String getType() {
         return ;
     }
 
     @Override
     public Relation getRelation(int index) {
         return .get(index);
     }
 
     @Override
     public Relation getRelation(Token token) {
         return ..get(token);
     }
 
     @Override
     public Token[] getTokens(Relation relation) {
        if (relation instanceof RelationStored) {
            RelationStored r = (RelationStoredrelation;
            return WlfUtilities.tokenIdsToTokens(r.tokRefs.);
        } else {
            throw new UnsupportedOperationException(WlfUtilities.layersErrorMessage(Relation.classRelationsLayer.class));
        }
    }
    @Override
    public Relation addRelation(String functionToken relationToken) {
        List<TokenrelTokens = Arrays.asList(new Token[]{relationToken});
        return addRelation(functionrelTokens);
    }
    @Override
    public Relation addRelation(Token relationToken) {
        return addRelation(nullrelationToken);
    }
    @Override
    public Relation addRelation(String functionList<TokenrelationTokens) {
        RelationStored rel = new RelationStored();
        rel.function = function;
        rel.tokRefs = new String[relationTokens.size()];
        for (int i = 0; i < relationTokens.size(); i++) {
            Token token = relationTokens.get(i);
            rel.tokRefs[i] = token.getID();
            ..put(tokenrel);
        }
        .add(rel);
        return rel;
    }
    @Override
    public Relation addRelation(List<TokenrelationTokens) {
        return addRelation(nullrelationTokens);
    }
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(" ");
        sb.append("{");
        sb.append();
        sb.append("} :");
        sb.append(.toString());
        return sb.toString();
    }
New to GrepCode? Check out our FAQ X