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
 
 public class GeoLayerStored extends TextCorpusLayerStoredAbstract implements GeoLayer {
 
     public static final String XML_NAME = "geo";
     @XmlElement(name = ., required = true)
     private String source;
     @XmlAttribute(name = "coordFormat", required = true)
     private GeoLongLatFormat coordFormat;
     @XmlAttribute(name = "continentFormat")
     @XmlAttribute(name = "countryFormat")
     private GeoCountryFormat countryFormat;
     @XmlAttribute(name = "capitalFormat")
     private GeoCapitalFormat capitalFormat;
     @XmlElement(name = .)
     private List<GeoPointStoredpoints = new ArrayList<GeoPointStored>();
 
     protected GeoLayerStored() {
     }
 
     protected GeoLayerStored(String sourceGeoLongLatFormat coordFormat) {
         this(sourcecoordFormatnullnullnull);
     }
 
     protected GeoLayerStored(String sourceGeoLongLatFormat coordFormat,
             GeoContinentFormat continentFormat) {
         this(sourcecoordFormatcontinentFormatnullnull);
     }
 
     protected GeoLayerStored(String sourceGeoLongLatFormat coordFormat,
             GeoContinentFormat continentFormatGeoCountryFormat countryFormat) {
         this(sourcecoordFormatcontinentFormatcountryFormatnull);
     }
 
     protected GeoLayerStored(String sourceGeoLongLatFormat coordFormat,
             GeoContinentFormat continentFormat,
             GeoCapitalFormat capitalFormat) {
         this(sourcecoordFormatcontinentFormatnullcapitalFormat);
     }
 
     protected GeoLayerStored(String sourceGeoLongLatFormat coordFormat,
             GeoCountryFormat countryFormat) {
         this(sourcecoordFormatnullcountryFormatnull);
     }
 
     protected GeoLayerStored(String sourceGeoLongLatFormat coordFormat,
             GeoCountryFormat countryFormatGeoCapitalFormat capitalFormat) {
         this(sourcecoordFormatnullcountryFormatcapitalFormat);
     }
 
     protected GeoLayerStored(String sourceGeoLongLatFormat coordFormat,
             GeoCapitalFormat capitalFormat) {
         this(sourcecoordFormatnullnullcapitalFormat);
     }
 
     protected GeoLayerStored(String sourceGeoLongLatFormat coordFormat,
             GeoContinentFormat continentFormatGeoCountryFormat countryFormat,
             GeoCapitalFormat capitalFormat) {
         this. = source;
         this. = coordFormat;
        this. = continentFormat;
        this. = countryFormat;
        this. = capitalFormat;
    }
    protected GeoLayerStored(TextCorpusLayersConnector connector) {
        this. = connector;
    }
    protected void setLayersConnector(TextCorpusLayersConnector connector) {
        this. = connector;
        for (GeoPointStored point : ) {
            for (String tokRef : point.tokRefs) {
                connector.token2ItsGeopoint.put(connector.tokenId2ItsToken.get(tokRef), point);
            }
        }
    }
    @Override
    public boolean isEmpty() {
        return .isEmpty();
    }
    @Override
    public int size() {
        return .size();
    }
    @Override
    public String getSource() {
        return ;
    }
    @Override
        return this.;
    }
    @Override
        return this.;
    }
    @Override
        return this.;
    }
    @Override
        return this.;
    }
    @Override
    public GeoPoint getPoint(int index) {
        return .get(index);
    }
    @Override
    public GeoPoint getPoint(Token token) {
        GeoPoint point = ..get(token);
        return point;
    }
    @Override
    public Token[] getTokens(GeoPoint point) {
        if (point instanceof GeoPointStored) {
            GeoPointStored p = (GeoPointStoredpoint;
            return WlfUtilities.tokenIdsToTokens(p.tokRefs.);
        } else {
            return null;
        }
    }
    @Override
    public GeoPoint addPoint(String longitudeString latitude,
            Double altitudeString continentString countryString capital,
            Token pointToken) {
        List<Tokentokens = Arrays.asList(new Token[]{pointToken});
        return addPoint(longitudelatitudealtitudecontinentcountrycapitaltokens);
    }
    @Override
    public GeoPoint addPoint(String longitudeString latitude,
            Double altitudeString continentString countryString capital,
            List<TokenpointTokens) {
        GeoPointStored p = new GeoPointStored();
        p.longitude = longitude;
        p.latitude = latitude;
        p.altitude = altitude;
        p.continent = continent;
        p.country = country;
        p.capital = capital;
        p.tokRefs = new String[pointTokens.size()];
        for (int i = 0; i < pointTokens.size(); i++) {
            Token token = pointTokens.get(i);
            p.tokRefs[i] = token.getID();
            ..put(tokenp);
        }
        .add(p);
        return p;
    }
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(" ");
        sb.append("{");
        sb.append();
        sb.append(",");
        sb.append();
        if (this. != null) {
            sb.append(",");
            sb.append(.name());
        }
        if (this. != null) {
            sb.append(",");
            sb.append(.name());
        }
        if (this. != null) {
            sb.append(",");
            sb.append(.name());
        }
        sb.append("} :");
        sb.append(.toString());
        return sb.toString();
    }
New to GrepCode? Check out our FAQ X