/**
  * Returns the type of the network for this Connection.
  *
  * @return the type of the network
  * @throws com.colibria.android.sipservice.sdp.api.SdpParseException
  */
 public String getAddress() throws SdpParseException {
   ConnectionAddress connectionAddress = getConnectionAddress();
   if (connectionAddress == null) return null;
   else {
     Host host = connectionAddress.getAddress();
     if (host == null) return null;
     else return host.getAddress();
   }
 }
 /**
  * Get the string encoded version of this object
  *
  * @since v1.0
  */
 public String encode() {
   String encoded_string = CONNECTION_FIELD;
   if (nettype != null) encoded_string += nettype;
   if (addrtype != null) encoded_string += Separators.SP + addrtype;
   if (address != null) encoded_string += Separators.SP + address.encode();
   return encoded_string += Separators.NEWLINE;
 }
 /**
  * Sets the type of the address for this Connection.
  *
  * @param addr to set
  * @throws com.colibria.android.sipservice.sdp.api.SdpException if the type is null
  */
 public void setAddress(String addr) throws SdpException {
   if (addr == null) throw new SdpException("the addr is null");
   else {
     if (address == null) {
       address = new ConnectionAddress();
       Host host = new Host(addr);
       address.setAddress(host);
     } else {
       Host host = address.getAddress();
       if (host == null) {
         host = new Host(addr);
         address.setAddress(host);
       } else host.setAddress(addr);
     }
     setAddress(address);
   }
 }