public final class SensorAdapterFactory
extends java.lang.Object
SensorAdapter objects. A sensor adapter needs to be
located within the sub-package "adapter" and to implement the Sensor interface.| Modifier | Constructor and Description |
|---|---|
private |
SensorAdapterFactory()
Private default constructor to prevent instance creation of this utility class.
|
| Modifier and Type | Method and Description |
|---|---|
static SensorAdapter |
getConnectedSensorAdapter(java.lang.String className,
ReasonerDimension dimension)
Loads the adapter specified by its class name from the sub-package "adapter" using
getSensorAdapter(String, ReasonerDimension) and connects it afterwards using
SensorAdapter.connect(). |
static SensorAdapter |
getSensorAdapter(java.lang.String className,
ReasonerDimension dimension)
Tries to instantiate a
SensorAdapter by a supplied class name from the sub-package "adapter". |
private SensorAdapterFactory()
public static SensorAdapter getConnectedSensorAdapter(java.lang.String className, ReasonerDimension dimension)
getSensorAdapter(String, ReasonerDimension) and connects it afterwards using
SensorAdapter.connect(). It will then return the SensorAdapter object. If the
SensorAdapter could not be found or instantiated, null will be returned instead.className - The SensorAdapters class name as string.dimension - The ReasonerDimension for which the sensor will supply values.SensorAdapter on success, otherwise null.public static SensorAdapter getSensorAdapter(java.lang.String className, ReasonerDimension dimension)
SensorAdapter by a supplied class name from the sub-package "adapter". If the
SensorAdapter could not be found or instantiated, null will be returned instead.className - The SensorAdapters class name as string.dimension - The ReasonerDimension for which the sensor will supply values.SensorAdapter on success, null otherwise.