func (this *AddressImpl) String() string {
	if this.addressType == WILD_CARD {
		return "*"
	}
	var encoding bytes.Buffer
	if this.displayName != "" {
		encoding.WriteString(core.SIPSeparatorNames_DOUBLE_QUOTE)
		encoding.WriteString(this.displayName)
		encoding.WriteString(core.SIPSeparatorNames_DOUBLE_QUOTE)
		encoding.WriteString(core.SIPSeparatorNames_SP)
	}
	if this.address != nil {
		if this.addressType == NAME_ADDR || this.displayName != "" {
			encoding.WriteString(core.SIPSeparatorNames_LESS_THAN)
		}
		encoding.WriteString(this.address.String())
		if this.addressType == NAME_ADDR || this.displayName != "" {
			encoding.WriteString(core.SIPSeparatorNames_GREATER_THAN)
		}
	}
	return encoding.String()
}
Encode the address as a string and return it.
@return String canonical encoded version of this address.
package address
import (
	"bytes"
	"errors"
	"sip/core"
)
const (
	NAME_ADDR = iota
	ADDRESS_SPEC
	WILD_CARD
)
type AddressImpl struct {
	addressType int
	displayName string
	address URI  
}
func NewAddressImpl() *AddressImpl {
	return &AddressImpl{}
}
func (this *AddressImpl) GetHostPort() (hp *core.HostPort, RuntimeException error) {
	if sipuri, ok := this.address.(*SipURIImpl); ok {
		return sipuri.GetHostPort(), nil
	}
	return nil, errors.New("RuntimeException: address is not a SipURIImpl")
}
func (this *AddressImpl) GetPort() (int, error) {
	if sipuri, ok := this.address.(*SipURIImpl); ok {
		return sipuri.GetHostPort().GetPort(), nil
	}
	return -1, errors.New("RuntimeException: address is not a SipURIImpl")
}
func (this *AddressImpl) GetUserAtHostPort() string {
	if sipuri, ok := this.address.(*SipURIImpl); ok {
		sipuri.GetUserAtHostPort()
	}
	return this.address.String()
}
func (this *AddressImpl) GetHost() (string, error) {
	if sipuri, ok := this.address.(*SipURIImpl); ok {
		return sipuri.GetHostPort().GetHost().GetHostName(), nil
	}
	return "", errors.New("RuntimeException: address is not a SipURIImpl")
}
func (this *AddressImpl) RemoveParameter(parameterName string) error {
	if sipuri, ok := this.address.(*SipURIImpl); ok {
		sipuri.RemoveParameter(parameterName)
		return nil
	}
	return errors.New("RuntimeException: address is not a SipURIImpl")
}