org.jppf.net
Class IPv6AddressPattern

java.lang.Object
  extended by org.jppf.net.AbstractIPAddressPattern
      extended by org.jppf.net.IPv6AddressPattern

public class IPv6AddressPattern
extends AbstractIPAddressPattern

Represents a pattern used for IPv6 addresses inclusion and exclusion lists.
A pattern represents a single value or a range of values for each component of an IPv6 address.

Examples:

Syntax rules:

1. An empty component is considered as a 0-FFFF range. Examples:

2. Ranges with missing bounds but still including the "-" sign are interpreted as a range with the lower bound equal to zero for a missing lower bound, and an upper bound equal to 0xFFFF if the uper bound is missing. Examples:

3. Valid values for range bounds and single values are positive integers in the range 0 ... 0xFFFF. A pattern containing any invalid value will be ignored.

4. A pattern describing more than 8 components or containing characters other than hexadecimal digits, '-', ':' or spaces will be ignored.

Author:
Laurent Cohen

Constructor Summary
IPv6AddressPattern(String source)
          Initialize this object with the specified string pattern.
 
Method Summary
static void main(String[] args)
          Main method.
 boolean matches(InetAddress ip)
          Determine whether the specified IP address matches this pattern.
 String toString()
          
 
Methods inherited from class org.jppf.net.AbstractIPAddressPattern
convertSource, matches, postProcess, preProcess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IPv6AddressPattern

public IPv6AddressPattern(String source)
                   throws IllegalArgumentException
Initialize this object with the specified string pattern.

Parameters:
source - the source pattern as a string.
Throws:
IllegalArgumentException - if the pattern is null or invalid.
Method Detail

matches

public boolean matches(InetAddress ip)
Determine whether the specified IP address matches this pattern. No check is made to verify that the IP address is valid.

Overrides:
matches in class AbstractIPAddressPattern
Parameters:
ip - the ip to match as a string.
Returns:
true if the address matches this pattern, false otherwise.

toString

public String toString()

Overrides:
toString in class AbstractIPAddressPattern

main

public static void main(String[] args)
Main method.

Parameters:
args - not used.


Copyright © 2005-2010 JPPF Team.