org.cdlib.xtf.dynaXML
Class IpList.IpAddr

Object
  extended by IpList.IpAddr
Enclosing class:
IpList

private class IpList.IpAddr
extends Object

Data class to keep track of the four numeric components of an IP address.


Field Summary
 int[] components
           
 
Constructor Summary
IpList.IpAddr()
          Constructs a blank IP address structure
IpList.IpAddr(int c0, int c1, int c2, int c3)
          Constructs an IP address from the four numeric components
 
Method Summary
(package private)  boolean componentsEqual(IpList.IpAddr other, int nComps)
          Checks if the first 'nComps' components of this IP address are equal to the specified one.
(package private)  String parse(String str)
          Parses a string of the form "aaa.bbb.ccc.ddd", replacing the contents of this IP address structure with the results.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

components

public int[] components
Constructor Detail

IpList.IpAddr

IpList.IpAddr()
Constructs a blank IP address structure


IpList.IpAddr

IpList.IpAddr(int c0,
              int c1,
              int c2,
              int c3)
Constructs an IP address from the four numeric components

Method Detail

componentsEqual

boolean componentsEqual(IpList.IpAddr other,
                        int nComps)
Checks if the first 'nComps' components of this IP address are equal to the specified one.

Parameters:
other - The IP address to compare to
nComps - How many components to compare (1-4)

parse

String parse(String str)
Parses a string of the form "aaa.bbb.ccc.ddd", replacing the contents of this IP address structure with the results. The components don't need all three digits to be valid.

Parameters:
str - String to parse
Returns:
The remainder that wasn't part of the IP address, or null if no IP address could be parsed.