|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--socks.InetRange
Class InetRange provides the means of defining the range of inetaddresses. It's used by Proxy class to store and look up addresses of machines, that should be contacted directly rather then through the proxy.
InetRange provides several methods to add either standalone addresses, or ranges (e.g. 100.200.300.0:100.200.300.255, which covers all addresses on on someones local network). It also provides methods for checking wether given address is in this range. Any number of ranges and standalone addresses can be added to the range.
Constructor Summary | |
InetRange()
Creates the empty range. |
Method Summary | |
void |
add(java.net.InetAddress ip)
Adds another ip for this range. |
void |
add(java.net.InetAddress from,
java.net.InetAddress to)
Adds another range of ips for this range.Any host with ip address greater than or equal to the address of from and smaller than or equal to the address of to will be included in the range. |
boolean |
add(java.lang.String s)
Adds another host or range to this range. |
java.lang.Object |
clone()
Creates a clone of this Object |
boolean |
contains(java.net.InetAddress ip)
Checks wether the given ip is in the range. |
boolean |
contains(java.lang.String host)
Checks wether the givan host is in the range. |
boolean |
contains(java.lang.String host,
boolean attemptResolve)
Checks wether the given host is in the range. |
java.lang.String[] |
getAll()
Get all entries in the range as strings. |
boolean |
remove(java.lang.String s)
Removes an entry from this range. |
java.lang.String |
toString()
Get string representaion of this Range. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public InetRange()
Method Detail |
public boolean add(java.lang.String s)
public void add(java.net.InetAddress ip)
ip
- IP os the host which should be added to this range.public void add(java.net.InetAddress from, java.net.InetAddress to)
from
- IP from where range starts(including).to
- IP where range ends(including).public boolean contains(java.lang.String host)
host
- Host name to check.contains(String,boolean)
public boolean contains(java.lang.String host, boolean attemptResolve)
Algorithm:
host
- Host name to check.attemptResolve
- Wether to lookup ip address which corresponds
to the host,if required.public boolean contains(java.net.InetAddress ip)
ip
- Address of the host to check.public java.lang.String[] getAll()
remove(String)
public boolean remove(java.lang.String s)
s
- Entry to remove.public java.lang.String toString()
public java.lang.Object clone()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |