JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util
Class JCIPAddress

java.lang.Object
  |
  +--com.klg.jclass.util.JCIPAddress
All Implemented Interfaces:
Serializable

public class JCIPAddress
extends Object
implements Serializable

The JCIPAddress class stores an IP address and it will not try to resolve the IP address on the network.

See Also:
Serialized Form

Field Summary
protected  int[] address
           
static int MAX_VALUE
           
static int MIN_VALUE
           
 
Constructor Summary
JCIPAddress(InetAddress inet)
          Creates a JCIPAddress given a java.net.InetAddress.
JCIPAddress(int[] address)
          Creates a JCIPAddress an array of ints.
JCIPAddress(String ip)
          Creates a JCIPAddress given a String.
 
Method Summary
 InetAddress getInetAddress()
          Returns the IP.
 int[] getIPAddress()
          Returns the IP address as an array of ints.
protected  void parseStringIP(String ip)
          Given an IP String, it will store each subfield in the address array.
 String toString()
          Returns the IP as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

address

protected int[] address

MAX_VALUE

public static int MAX_VALUE

MIN_VALUE

public static int MIN_VALUE
Constructor Detail

JCIPAddress

public JCIPAddress(String ip)
Creates a JCIPAddress given a String.

Parameters:
ip - format for the String should be %d.%d.%d.%d.

JCIPAddress

public JCIPAddress(InetAddress inet)
Creates a JCIPAddress given a java.net.InetAddress. It calls InetAddress.getHostAddress to obtain the IP.

Parameters:
inet -

JCIPAddress

public JCIPAddress(int[] address)
Creates a JCIPAddress an array of ints.

Parameters:
address -
Method Detail

parseStringIP

protected void parseStringIP(String ip)
Given an IP String, it will store each subfield in the address array.

Parameters:
ip -

toString

public String toString()
Returns the IP as a String. It will be in the following format: %d.%d.%d.%d.

Overrides:
toString in class Object
Returns:
IP as a String

getInetAddress

public InetAddress getInetAddress()
Returns the IP. The IP will be in a java.net.InetAddress object. If the IP is invalid, null will be returned.

Returns:
IP in a java.net.InetAddress object

getIPAddress

public int[] getIPAddress()
Returns the IP address as an array of ints.

Returns:
IP address as an array of ints

Copyright © 2004 Quest Software Inc..
All rights reserved.