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, removeListener
clearProperties, getName, getProperties, getProperty, getProperty, getTag, hasProperty, removeProperty, setName, setProperty, setTag
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getValue
removeAllListeners
clearProperties, getName, getProperties, getProperty, getProperty, getTag, hasProperty, removeProperty, setName, setProperty, setTag
protected Date lastDistanceTimestamp
public Date getLastDistanceTimestamp()
getLastDistanceTimestamp
in interface DistanceSensor
public void addListener(DistanceSensorListener... listener)
addListener
in interface DistanceSensor
public void removeListener(DistanceSensorListener... listener)
removeListener
in interface DistanceSensor
protected void notifyListeners(DistanceSensorChangeEvent event)
public boolean isValue(double value)
isValue
in interface DistanceSensor
public boolean isValueInRange(double min, double max)
isValueInRange
in interface DistanceSensor
public double getDistance()
getDistance
in interface DistanceSensor
public double getDistance(double value)
getDistance
in interface DistanceSensor
public boolean isDistance(double distance)
isDistance
in interface DistanceSensor
public boolean isDistanceInRange(double min, double max)
isDistanceInRange
in interface DistanceSensor
public void addCalibrationCoordinate(double value, double distance)
addCalibrationCoordinate
in interface DistanceSensor
Copyright © 2012–2014 Pi4J. All rights reserved.