
package Logic;

public class RangePredicate extends APredicate
{
	private int minVal;
	private int maxVal;

	/**
	 * @param minVal 
	 * @param maxVal 
	 * @SBGen Constructor assigns minVal, maxVal
	 */
	public RangePredicate(int minVal, int maxVal)
	{
		// SBgen: Assign variables
		this.minVal = minVal;
		this.maxVal = maxVal;
		// SBgen: End assign
	}

	/**
	 * @param dat 
	 * @return 
	 */
	public ILogical isTrue(Object dat)
	{
		int x = ((Integer)dat).intValue();
		return (LogicFactory.Singleton().makeLogical( (x>=minVal) && (x<=maxVal)));
	}
}

