org.aselect.agent.authorization.parsing.types
Class IPv6Address

java.lang.Object
  extended by org.aselect.agent.authorization.parsing.types.IPv6Address
All Implemented Interfaces:
java.lang.Comparable

public class IPv6Address
extends java.lang.Object
implements java.lang.Comparable

IP Version 6 Address.

Description:
A simple Java object to compare IPv6 adresses.

Only default IPv6 adresses with subnet mask are supported: x:x:x:x:x:x:x:x(/x:x:x:x:x:x:x:x or /x), where the 'x's are the hexadecimal values of the eight 16-bit pieces of the address.

Examples:


Concurrency issues:
-

Author:
Alfa & Ariss
See Also:
IP Version 6 Addressing Architecture

Field Summary
static java.lang.String IPV6_REGEX
          Regex for IP v6 address.
 
Constructor Summary
IPv6Address(java.lang.String s)
          Create new IPv6Address.
 
Method Summary
 int compareTo(java.lang.Object oOther)
          Compare two ip adresses (Only equals is supported).
 java.lang.String toString()
          Retrieve a String representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IPV6_REGEX

public static final java.lang.String IPV6_REGEX
Regex for IP v6 address.

See Also:
Constant Field Values
Constructor Detail

IPv6Address

public IPv6Address(java.lang.String s)
            throws java.lang.Exception
Create new IPv6Address.

Parameters:
s - The String respresentation of the address.
Throws:
java.lang.Exception - If parsing fails.
Method Detail

compareTo

public int compareTo(java.lang.Object oOther)
              throws java.lang.ClassCastException
Compare two ip adresses (Only equals is supported).

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
oOther - The object to compare with.
Returns:
0 if the ip adresses are equal with network mask taken in account, otherwise -1.
Throws:
java.lang.ClassCastException - If the provided Object is not an IPv6Address.

toString

public java.lang.String toString()
Retrieve a String representation.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2008 SURFnet BV. All Rights Reserved.