IPPortCheckerRange.java

package com.ziesemer.utils.web.addressFilter.conditions;

/**
 * @author Mark A. Ziesemer
 * 	<a href="http://www.ziesemer.com.">&lt;www.ziesemer.com&gt;</a>
 */
public class IPPortCheckerRange implements IPortChecker{
	
	protected final int beginPort;
	protected final int endPort;
	
	public IPPortCheckerRange(final int beginPort, final int endPort){
		this.beginPort = beginPort;
		this.endPort = endPort;
	}
	
	public boolean matches(final int port) throws Exception{
		return port >= beginPort && port <= endPort;
	}
	
	public int getBeginPort(){
		return beginPort;
	}
	
	public int getEndPort(){
		return endPort;
	}
	
}