Class AbstractSensor
- java.lang.Object
-
- io.patriot_framework.generator.device.AbstractDevice
-
- io.patriot_framework.generator.device.passive.sensors.AbstractSensor
-
- Direct Known Subclasses:
AbstractSimpleSensor
,DHT11
public abstract class AbstractSensor extends AbstractDevice implements Sensor
Abstract class for device Composition - one unit with multiple DataFeeds
-
-
Constructor Summary
Constructors Constructor Description AbstractSensor()
AbstractSensor(String label, DataFeed... dataFeeds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDataFeed(DataFeed dataFeed)
Adds DataFeed to CompositionList<DataFeed>
getDataFeeds()
Returns list of all DataFeeds for Compositionvoid
removeDataFeed(DataFeed dataFeed)
Removes DataFeed from CompositionList<Data>
requestData(Object... param)
Pulls data from data feed.-
Methods inherited from class io.patriot_framework.generator.device.AbstractDevice
getCoapController, getDataObservable, getLabel, getNetworkAdapter, getUUID, setCoapController, setDataObservable, setLabel, setNetworkAdapter, setUUID, startCoapController, stopCoapController
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.patriot_framework.generator.device.Device
getCoapController, getDataObservable, getNetworkAdapter, setCoapController, setDataObservable, setNetworkAdapter, startCoapController, stopCoapController
-
-
-
-
Method Detail
-
requestData
public List<Data> requestData(Object... param)
Description copied from interface:Device
Pulls data from data feed. This method serves as handler for data from DataFeed. Forwards parameters for getNextValue method (see DataFeed.getNextValue).- Specified by:
requestData
in interfaceDevice
- Parameters:
param
- for DataFeed computing- Returns:
- a list of generated values
-
addDataFeed
public void addDataFeed(DataFeed dataFeed)
Description copied from interface:Sensor
Adds DataFeed to Composition- Specified by:
addDataFeed
in interfaceSensor
- Parameters:
dataFeed
- instance of DataFeed
-
removeDataFeed
public void removeDataFeed(DataFeed dataFeed)
Description copied from interface:Sensor
Removes DataFeed from Composition- Specified by:
removeDataFeed
in interfaceSensor
- Parameters:
dataFeed
- instance of DataFeed
-
getDataFeeds
public List<DataFeed> getDataFeeds()
Description copied from interface:Sensor
Returns list of all DataFeeds for Composition- Specified by:
getDataFeeds
in interfaceSensor
- Returns:
- list of DataFeeds
-
-