/*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * (the "License"); you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
 * 
 * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
 * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
 * language governing rights and limitations under the License.
 * 
 * The Original Code is the Venice Web Communities System.
 * 
 * The Initial Developer of the Original Code is Eric J. Bowersox <erbo@ricochet.com>,
 * for Silverwrist Design Studios.  Portions created by Eric J. Bowersox are
 * Copyright (C) 2004 Eric J. Bowersox/Silverwrist Design Studios.  All Rights Reserved.
 * 
 * Contributor(s): 
 */
package com.silverwrist.venice.util;

public class BuildVCardAddress
{
  /*--------------------------------------------------------------------------------
   * Attributes
   *--------------------------------------------------------------------------------
   */

  private boolean home_adr = false;
  private boolean work_adr = false;
  private boolean postal_adr = false;
  private boolean parcel_adr = false;
  private boolean domestic_adr = false;
  private boolean intl_adr = false;
  private boolean preferred = false;
  private String pobox = null;
  private String ext_address = null;
  private String street = null;
  private String locality = null;
  private String region = null;
  private String postal_code = null;
  private String country = null;

  /*--------------------------------------------------------------------------------
   * Constructor
   *--------------------------------------------------------------------------------
   */

  public BuildVCardAddress()
  { // do nothing
  } // end constructor

  /*--------------------------------------------------------------------------------
   * Public getters/setters
   *--------------------------------------------------------------------------------
   */

  public final boolean isHomeAddress()
  {
    return home_adr;

  } // end isHomeAddress

  public final void setHomeAddress(boolean f)
  {
    home_adr = f;

  } // end setHomeAddress

  public final boolean isWorkAddress()
  {
    return work_adr;

  } // end isWorkAddress

  public final void setWorkAddress(boolean f)
  {
    work_adr = f;

  } // end setWorkAddress

  public final boolean isPostalAddress()
  {
    return postal_adr;

  } // end isPostalAddress

  public final void setPostalAddress(boolean f)
  {
    postal_adr = f;

  } // end setPostalAddress

  public final boolean isParcelAddress()
  {
    return parcel_adr;

  } // end isParcelAddress

  public final void setParcelAddress(boolean f)
  {
    parcel_adr = f;

  } // end setParcelAddress

  public final boolean isDomesticAddress()
  {
    return domestic_adr;

  } // end isDomesticAddress

  public final void setDomesticAddress(boolean f)
  {
    domestic_adr = f;
    if (domestic_adr && intl_adr)
      intl_adr = false;

  } // end setDomesticAddress

  public final boolean isInternationalAddress()
  {
    return intl_adr;

  } // end isInternationalAddress

  public final void setInternationalAddress(boolean f)
  {
    intl_adr = f;
    if (domestic_adr && intl_adr)
      domestic_adr = false;

  } // end setInternationalAddress

  public final boolean isPreferred()
  {
    return preferred;

  } // end isPreferred

  public final void setPreferred(boolean f)
  {
    preferred = f;

  } // end setPreferred

  public final String getPOBox()
  {
    return pobox;

  } // end getPOBox

  public final void setPOBox(String s)
  {
    pobox = s;

  } // end setPOBox

  public final String getExtension()
  {
    return ext_address;

  } // end getExtension

  public final void setExtension(String s)
  {
    ext_address = s;

  } // end setExtension

  public final String getStreet()
  {
    return street;

  } // end getStreet

  public final void setStreet(String s)
  {
    street = s;

  } // end setStreet

  public final String getLocality()
  {
    return locality;

  } // end getLocality

  public final void setLocality(String s)
  {
    locality = s;

  } // end setLocality

  public final String getRegion()
  {
    return region;

  } // end getRegion

  public final void setRegion(String s)
  {
    region = s;

  } // end setRegion

  public final String getPostalCode()
  {
    return postal_code;

  } // end getPostalCode

  public final void setPostalCode(String s)
  {
    postal_code = s;

  } // end setPostalCode

  public final String getCountry()
  {
    return country;

  } // end getCountry

  public final void setCountry(String s)
  {
    country = s;

  } // end setCountry

  /*--------------------------------------------------------------------------------
   * External operations
   *--------------------------------------------------------------------------------
   */

  public void reset()
  {
    home_adr = false;
    work_adr = false;
    postal_adr = false;
    parcel_adr = false;
    domestic_adr = false;
    intl_adr = false;
    preferred = false;
    pobox = null;
    ext_address = null;
    street = null;
    locality = null;
    region = null;
    postal_code = null;
    country = null;

  } // end reset

  public VCardAddress create()
  {
    return new VCardAddress(home_adr,work_adr,postal_adr,parcel_adr,domestic_adr,intl_adr,preferred,pobox,ext_address,
			    street,locality,region,postal_code,country);

  } // end create

} // end class BuildVCardAddress
