package jpigpio;

public class GPIO {
	private JPigpio pigpio;
	private int pin;
	
	public GPIO(JPigpio pigpio, int pin) {
		assert pigpio != null;
		
		this.pigpio = pigpio;
		this.pin = pin;
	}
	
	
	public GPIO(JPigpio pigpio, int pin, int direction) throws PigpioException {
		this(pigpio, pin);
		setDirection(direction);
	}
	
	public int getDirection() throws PigpioException {
		return pigpio.gpioGetMode(pin);
	}
	
	public void setDirection(int direction) throws PigpioException {
		pigpio.gpioSetMode(pin, direction);
	}
	
	public void setValue(boolean value) throws PigpioException {
		pigpio.gpioWrite(pin, value);
	}
	
	public void setValue(int value) throws PigpioException {
		if (value !=0 && value != 1) {
			throw new BadValueException();
		}
		pigpio.gpioWrite(pin, value==1);
	}
	
	public boolean getValue() throws PigpioException {
		return pigpio.gpioRead(pin);
	}
	
	public int getPin() {
		return pin;
	}

    public void setAlert(Alert alert) throws PigpioException {
        pigpio.gpioSetAlertFunc(getPin(), alert);
    }

    public void setPulldown(int pulldown) throws PigpioException {
        pigpio.gpioSetPullUpDown(getPin(), pulldown);
    }

    public JPigpio getPigpio() {
        return pigpio;
    }
} // End of class
// End of file

@@ -1161,32 +1161,265 @@
 lldown);%0A    %7D%0A%0A
+    public void delay(long delay, int type) throws PigpioException %7B%0A        pigpio.gpioDelay(delay, type);%0A    %7D%0A%0A    /**%0A     *%0A     * Should only be needed if not mapped by gpio class%0A     *%0A     * @return Pigpio instance%0A     */%0A
     public JPigp

add delay delegation