All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gov.nasa.worldwind.util.xml.xal.XALCountry Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (C) 2012 United States Government as represented by the Administrator of the
 * National Aeronautics and Space Administration.
 * All Rights Reserved.
 */

package gov.nasa.worldwind.util.xml.xal;

import gov.nasa.worldwind.util.xml.XMLEventParserContext;

import javax.xml.stream.events.XMLEvent;
import javax.xml.stream.XMLStreamException;
import java.util.*;

/**
 * @author tag
 * @version $Id: XALCountry.java 1171 2013-02-11 21:45:02Z dcollins $
 */
public class XALCountry extends XALAbstractObject
{
    protected List addressLines;
    protected List countryNameCodes;
    protected List countryNames;

    public XALCountry(String namespaceURI)
    {
        super(namespaceURI);
    }

    @Override
    protected void doAddEventContent(Object o, XMLEventParserContext ctx, XMLEvent event, Object... args)
        throws XMLStreamException
    {
        if (o instanceof XALAddressLine)
            this.addAddressLine((XALAddressLine) o);
        else if (o instanceof XALCountryNameCode)
            this.addCountryNameCode((XALCountryNameCode) o);
        else if (o instanceof XALCountryName)
            this.addCountryName((XALCountryName) o);
        else
            super.doAddEventContent(o, ctx, event, args);
    }

    public List getAddressLines()
    {
        return this.addressLines;
    }

    protected void addAddressLine(XALAddressLine o)
    {
        if (this.addressLines == null)
            this.addressLines = new ArrayList();

        this.addressLines.add(o);
    }

    public List getCountryNameCodes()
    {
        return this.countryNameCodes;
    }

    protected void addCountryNameCode(XALCountryNameCode o)
    {
        if (this.countryNameCodes == null)
            this.countryNameCodes = new ArrayList();

        this.countryNameCodes.add(o);
    }

    public List getCountryNames()
    {
        return this.countryNames;
    }

    protected void addCountryName(XALCountryName o)
    {
        if (this.countryNames == null)
            this.countryNames = new ArrayList();

        this.countryNames.add(o);
    }

    public XALAdministrativeArea getAdministrativeArea()
    {
        return (XALAdministrativeArea) this.getField("AdministrativeArea");
    }

    public XALLocality getLocality()
    {
        return (XALLocality) this.getField("Locality");
    }

    public XALThoroughfare getThoroughfare()
    {
        return (XALThoroughfare) this.getField("Thoroughfare");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy