// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) fieldsfirst 
// Source File Name:   DoubleChecker.java

package lt.ktu.gmj.propertySheet;


// Referenced classes of package lt.ktu.gmj.propertySheet:
//			SimplePropertyProvider, PropertyReader, InvalidPropertyException, PropertyWriter, 
//			PropertyProvider

public class DoubleChecker extends SimplePropertyProvider
{

	private PropertyProvider provider;
	private double min;
	private double max;

	public Object get()
	{
		return provider.get();
	}

	public void set(Object obj)
		throws InvalidPropertyException
	{
		double d = ((Double)obj).doubleValue();
		if(d < min || d > max)
		{
			System.out.println("Value :" + d + "\nMin: " + min + "\nMax: " + max + "\n");
			throw new InvalidPropertyException("Out of bounds");
		} else
		{
			provider.set(obj);
			return;
		}
	}

	public DoubleChecker(PropertyProvider propertyprovider, double min, double max)
	{
		provider = propertyprovider;
		this.min = min;
		this.max = max;
	}
}
