public abstract class DistanceSensorBase extends ObserveableComponentBase implements DistanceSensor
| Modifier and Type | Field and Description |
|---|---|
protected SortedMap<Double,Double> |
coordinates |
protected Date |
lastDistanceTimestamp |
listeners| Constructor and Description |
|---|
DistanceSensorBase() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCalibrationCoordinate(double value,
double distance) |
void |
addListener(DistanceSensorListener... listener) |
double |
getDistance() |
double |
getDistance(double value) |
Date |
getLastDistanceTimestamp() |
boolean |
isDistance(double distance) |
boolean |
isDistanceInRange(double min,
double max) |
boolean |
isValue(double value) |
boolean |
isValueInRange(double min,
double max) |
protected void |
notifyListeners(DistanceSensorChangeEvent event) |
void |
removeListener(DistanceSensorListener... listener) |
addListener, removeAllListeners, removeListenerclearProperties, getName, getProperties, getProperty, getProperty, getTag, hasProperty, removeProperty, setName, setProperty, setTagclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetValueremoveAllListenersclearProperties, getName, getProperties, getProperty, getProperty, getTag, hasProperty, removeProperty, setName, setProperty, setTagprotected Date lastDistanceTimestamp
public Date getLastDistanceTimestamp()
getLastDistanceTimestamp in interface DistanceSensorpublic void addListener(DistanceSensorListener... listener)
addListener in interface DistanceSensorpublic void removeListener(DistanceSensorListener... listener)
removeListener in interface DistanceSensorprotected void notifyListeners(DistanceSensorChangeEvent event)
public boolean isValue(double value)
isValue in interface DistanceSensorpublic boolean isValueInRange(double min,
double max)
isValueInRange in interface DistanceSensorpublic double getDistance()
getDistance in interface DistanceSensorpublic double getDistance(double value)
getDistance in interface DistanceSensorpublic boolean isDistance(double distance)
isDistance in interface DistanceSensorpublic boolean isDistanceInRange(double min,
double max)
isDistanceInRange in interface DistanceSensorpublic void addCalibrationCoordinate(double value,
double distance)
addCalibrationCoordinate in interface DistanceSensorCopyright © 2012–2019 Pi4J. All rights reserved.