001package com.pi4j.io.gpio; 002 003import java.util.Collection; 004import java.util.List; 005 006import com.pi4j.io.gpio.event.GpioPinListener; 007import com.pi4j.io.gpio.trigger.GpioTrigger; 008 009/* 010 * #%L 011 * ********************************************************************** 012 * ORGANIZATION : Pi4J 013 * PROJECT : Pi4J :: Java Library (Core) 014 * FILENAME : GpioPinInput.java 015 * 016 * This file is part of the Pi4J project. More information about 017 * this project can be found here: http://www.pi4j.com/ 018 * ********************************************************************** 019 * %% 020 * Copyright (C) 2012 - 2013 Pi4J 021 * %% 022 * Licensed under the Apache License, Version 2.0 (the "License"); 023 * you may not use this file except in compliance with the License. 024 * You may obtain a copy of the License at 025 * 026 * http://www.apache.org/licenses/LICENSE-2.0 027 * 028 * Unless required by applicable law or agreed to in writing, software 029 * distributed under the License is distributed on an "AS IS" BASIS, 030 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 031 * See the License for the specific language governing permissions and 032 * limitations under the License. 033 * #L% 034 */ 035 036/** 037 * Gpio input pin interface. This interface is extension of {@link GpioPin} interface 038 * with listeners and triggers support.. 039 * 040 * @author Robert Savage (<a 041 * href="http://www.savagehomeautomation.com">http://www.savagehomeautomation.com</a>) 042 */ 043public interface GpioPinInput extends GpioPin { 044 045 Collection<GpioPinListener> getListeners(); 046 void addListener(GpioPinListener... listener); 047 void addListener(List<? extends GpioPinListener> listeners); 048 boolean hasListener(GpioPinListener... listener); 049 void removeListener(GpioPinListener... listener); 050 void removeListener(List<? extends GpioPinListener> listeners); 051 void removeAllListeners(); 052 053 Collection<GpioTrigger> getTriggers(); 054 void addTrigger(GpioTrigger... trigger); 055 void addTrigger(List<? extends GpioTrigger> triggers); 056 057 void removeTrigger(GpioTrigger... trigger); 058 void removeTrigger(List<? extends GpioTrigger> triggers); 059 void removeAllTriggers(); 060 061}