FileDocCategorySizeDatePackage
IPRangeImpl.javaAPI DocAzureus 3.0.3.42898Wed Dec 01 14:32:00 GMT 2004org.gudy.azureus2.pluginsimpl.local.ipfilter

IPRangeImpl

public class IPRangeImpl extends Object implements IPRange
author
parg

Fields Summary
private IPFilter
filter
private IpRange
range
Constructors Summary
protected IPRangeImpl(IPFilter _filter, IpRange _range)

		filter	= _filter;
		range	= _range;
	
Methods Summary
public voidcheckValid()

		range.checkValid();
	
public intcompareTo(java.lang.Object other)

		if ( !(other instanceof IPRangeImpl )){
			
			throw( new RuntimeException( "other object must be IPRange" ));
			
		}
		
		IPRangeImpl	o = (IPRangeImpl)other;
		
		String	ip1 = getStartIP();
		String	ip2 = o.getStartIP();
			
		int	res = ip1.compareTo(ip2);
		
		if ( res != 0 ){
			return( res );
		}
		
		ip1	= getEndIP();
		ip2 = o.getEndIP();
		
		if ( ip1 == null && ip2 == null ){
			return(0);
		}
		
		if ( ip1 == null ){
			return( -1 );
		}
		
		if ( ip2 == null ){
			return( 1 );
		}
		
		return( ip1.compareTo(ip2));
	
public voiddelete()

		filter.removeRange( this );
	
public booleanequals(java.lang.Object other)

		if ( !(other instanceof IPRangeImpl )){
			
			return( false );
		}
		
		return( compareTo( other ) == 0 );
	
public java.lang.StringgetDescription()

		return( range.getDescription());
	
public java.lang.StringgetEndIP()

		return( range.getEndIp());
	
protected IpRangegetRange()

		return( range );
	
public java.lang.StringgetStartIP()

		return( range.getStartIp());
	
public booleanisInRange(java.lang.String ipAddress)

		return( range.isInRange(ipAddress));
	
public booleanisSessionOnly()

		return( range.isSessionOnly());
	
public booleanisValid()

		return( range.isValid());
	
public voidsetDescription(java.lang.String str)

		range.setDescription(str);
	
public voidsetEndIP(java.lang.String str)

		range.setEndIp(str);
	
public voidsetSessionOnly(boolean sessionOnly)

		range.setSessionOnly(sessionOnly);
	
public voidsetStartIP(java.lang.String str)

		range.setStartIp(str);