sg.edu.nus.util
Class Inet

java.lang.Object
  extended by sg.edu.nus.util.Inet

public class Inet
extends java.lang.Object

A utility used for obtaining IP-related information.

Version:
1.0 2006-2-1
Author:
Xu Linhao

Constructor Summary
Inet()
           
 
Method Summary
static java.lang.String getInetAddress()
          Returns the string representation of the IP address.
static java.net.InetAddress getInetAddress2()
          Returns the InetAddress.
static boolean isValidInetAddress(java.lang.String ip)
          Check if the IP address is valid.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Inet

public Inet()
Method Detail

getInetAddress

public static java.lang.String getInetAddress()
Returns the string representation of the IP address.

Returns:
the string representation of the IP address; if an Exception appears, then return a null value

getInetAddress2

public static java.net.InetAddress getInetAddress2()
Returns the InetAddress.

Returns:
the InetAddress; if an Exception appears, then return a null value

isValidInetAddress

public static boolean isValidInetAddress(java.lang.String ip)
Check if the IP address is valid.

Parameters:
ip - the IP address represented by a String
Returns:
if the IP address is valid, return true; otherwise, return false