FileDocCategorySizeDatePackage
ConnectionAddress.javaAPI DocphoneME MR2 API (J2ME)3188Wed May 02 18:00:42 BST 2007gov.nist.javax.sdp.fields

ConnectionAddress

public class ConnectionAddress extends SDPObject
Connection Address of the SDP header (appears as part of the Connection field). This code is in the public domain.

Fields Summary
protected Host
address
The host address.
protected int
ttl
Time to live.
protected int
port
The target port.
Constructors Summary
Methods Summary
public java.lang.Objectclone()
Copies the current instance.

return
the copy of this object

	ConnectionAddress retval = new ConnectionAddress();
	if (address != null) 
	    retval.address = (Host) address.clone();
	retval.ttl = ttl;
	retval.port = port;
	return retval;
    
public java.lang.Stringencode()
Gets the string encoded version of this object.

return
the encode string of the object contents
since
v1.0

	String encoded_string = "";

	if (address != null) encoded_string = address.encode();
	if (ttl != 0 && port != 0) {
	    encoded_string += Separators.SLASH + 
		ttl + Separators.SLASH + port;
	} else if (ttl != 0) {
	    encoded_string += Separators.SLASH + ttl;
	}
	return encoded_string; 
    
public HostgetAddress()
Gets the target host address.

return
the host address

	return address; 
    
public intgetPort()
Gets the target port address.

return
the port number

	return port;
    
public intgetTtl()
Gets the time to live parameter.

return
the time to live value

	return ttl;
    
public voidsetAddress(Host a)
Sets the address member.

param
a the new value for address

	address = a;
    
public voidsetPort(int p)
Sets the port member.

param
p the new target port number

	port = p; 
    
public voidsetTtl(int ttl)
Sets the time to live member.

param
ttl the new time to live value

	this.ttl = ttl;