NIST SIP Parser and Stack (v1.2) API

gov.nist.core
Class HostPort

java.lang.Object
  |
  +--gov.nist.core.GenericObject
        |
        +--gov.nist.core.HostPort

public final class HostPort
extends GenericObject

Holds the hostname:port.

Version:
JAIN-SIP-1.1
Author:
M. Ranganathan
This code is in the public domain.

Constructor Summary
HostPort()
          Default constructor
 
Method Summary
 Object clone()
          Make a clone of this object.
 String encode()
          Encode this hostport into its string representation.
 boolean equals(Object other)
          returns true if the two objects are equals, false otherwise.
 Host getHost()
          get the Host field
 InetAddress getInetAddress()
          Return the internet address corresponding to the host.
 int getPort()
          get the port field
 boolean hasPort()
          Returns boolean value indicating if Header has port
 void removePort()
          remove port.
 void setHost(Host h)
          Set the host member
 void setPort(int p)
          Set the port member
 
Methods inherited from class gov.nist.core.GenericObject
debugDump, debugDump, getClassFromName, getMatcher, isMySubclass, match, merge, replace, replace, replace, replace, setMatcher
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HostPort

public HostPort()
Default constructor

Method Detail

encode

public String encode()
Encode this hostport into its string representation. Note that this could be different from the string that has been parsed if something has been edited.

Specified by:
encode in class GenericObject
Returns:
String

equals

public boolean equals(Object other)
returns true if the two objects are equals, false otherwise.

Overrides:
equals in class GenericObject
Parameters:
other - Object to set
Returns:
boolean

getHost

public Host getHost()
get the Host field

Returns:
host field

getPort

public int getPort()
get the port field

Returns:
int

hasPort

public boolean hasPort()
Returns boolean value indicating if Header has port

Returns:
boolean value indicating if Header has port

removePort

public void removePort()
remove port.


setHost

public void setHost(Host h)
Set the host member

Parameters:
h - Host to set

setPort

public void setPort(int p)
Set the port member

Parameters:
p - int to set

getInetAddress

public InetAddress getInetAddress()
                           throws UnknownHostException
Return the internet address corresponding to the host.

Returns:
the inet address for the host.
Throws:
java.net.UnkownHostException - if host name cannot be resolved.
UnknownHostException

clone

public Object clone()
Description copied from class: GenericObject
Make a clone of this object.

Overrides:
clone in class GenericObject

NIST SIP Parser and Stack (v1.2) API

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Get the latest distribution.
Submit a bug report or feature request.