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

package lt.ktu.gmj.propertySheet;


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

public class IntChecker extends SimplePropertyProvider
{

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

    public void set(Object obj)
        throws InvalidPropertyException
    {
        double d = ((Integer)obj).intValue();
        if (d < (double)min || d > (double)max)
        {
            throw new InvalidPropertyException("Out of bounds");
        } else
        {
            provider.set(obj);
            return;
        }
    }

    public IntChecker(PropertyProvider propertyprovider, int i, int j)
    {
        provider = propertyprovider;
        min = i;
        max = j;
        provider.addObserver(this);
    }

    private PropertyProvider provider;
    private int min;
    private int max;
}
