|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.limegroup.gnutella.filters.IP
An IP address. More precisely, a set of IP addresses specified by a regular expression (e.g., "18.239.*.*") or a submask (e.g., "18.239.0.0/255.255.0.0". Immutable. Used to implement IPFilter; the generic usefulness of this class is questionable. This class is heavily optimized, as IP objects are constructed for every PingReply, QueryReply, PushRequest, and internally or externally generated connection.
Constructor Summary | |
IP(byte[] ip_bytes)
Creates an IP object out of a four byte array of the IP in BIG ENDIAN format (most significant byte first). |
|
IP(java.lang.String ip_str)
Creates an IP object out of a String in the format "0.0.0.0", "0.0.0.0/0.0.0.0" or "0.0.0.0/0" |
Method Summary | |
boolean |
contains(IP ip)
Returns if ip is contained in this. |
boolean |
equals(java.lang.Object other)
Returns true if other is an IP with the same address and mask. |
int |
hashCode()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IP(byte[] ip_bytes) throws java.lang.IllegalArgumentException
public IP(java.lang.String ip_str) throws java.lang.IllegalArgumentException
ip_str
- a String of the format "0.0.0.0", "0.0.0.0/0.0.0.0",
or "0.0.0.0/0" as an argument.Method Detail |
public boolean contains(IP ip)
ip
- a singleton IP set, e.g., one representing a single addresspublic boolean equals(java.lang.Object other)
public int hashCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |