|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Classes that represent an input-device should implement this interface. Implementations of this interface represent specific interpretations of the value this Sensor delivers.
Method Summary | |
void |
addPropertyChangeListener(PropertyChangeListener l)
A PropertyChangeListener receives PropertyChangeEvents whenever this Sensor receives a SensorEvent. |
void |
addSensorListener(SensorListener listener)
Adds the specified SensorListener to this Sensor so that it receives SensorEvents from it. |
void |
connectWith(Port port)
Connects the Sensor with the given Port. |
void |
disconnect()
Disconnects this Sensor from it's Peer and it's Port. |
int |
getIntValue()
Returns the value this Sensor represents as an int. |
Port |
getPort()
Returns the Port to which this Sensor is connected. |
double |
getPrecision()
Returns the maximum of the expectable error in the value. |
SensorPort |
getSensorPort()
Returns a Port through which other Sensors can be connected to this Sensor. |
double |
getValue()
Returns the value this Sensor represents as a double. |
boolean |
isConnected()
Tells wether this Sensor has a Peer and whether the Peer is also connected. |
void |
processEvent(SensorEvent event)
This Method is called when the value this Sensor resembles has changed and events are enabled. |
void |
propertyChange(PropertyChangeEvent event)
This is the method through which a Sensor gets informed about changes in the hardware-value it resembles. |
void |
removePropertyChangeListener(PropertyChangeListener l)
Remove the specified listener. |
void |
removeSensorListener(SensorListener listener)
Removes the specified SensorListener so that it no longer receives SensorEvents from this Sensor. |
void |
update()
Causes a new SensorEvent for this Sensor to be generated and delivered. |
Method Detail |
public int getIntValue()
getValue()
because this method may involve casting with a loss of precision.getValue()
public double getValue()
public void connectWith(Port port)
SensorPort
public boolean isConnected()
RobotInterface
this Peer belongs to is not connected.SensorPeer.isConnected()
,
RobotInterface.isConnected()
,
connectWith(Port)
public void disconnect()
connectWith(Port)
public void addSensorListener(SensorListener listener)
removeSensorListener(SensorListener)
,
SensorListener.processEvent(SensorEvent)
public void removeSensorListener(SensorListener listener)
addSensorListener(SensorListener)
,
SensorListener.processEvent(SensorEvent)
public void addPropertyChangeListener(PropertyChangeListener l)
value
.
This mechanism in the Sensor is not really used for anything else right now but may be in future releases.addSensorListener(SensorListener)
,
SensorListener.processEvent(SensorEvent)
public void removePropertyChangeListener(PropertyChangeListener l)
addPropertyChangeListener(PropertyChangeListener)
public void propertyChange(PropertyChangeEvent event)
processEvent(SensorEvent)
.propertyChange
in interface PropertyChangeListener
processEvent(SensorEvent)
public void processEvent(SensorEvent event)
propertyChange(PropertyChangeEvent)
this method is not interested in the new value but in the SensorEvent which resembles the change.propertyChange(java.beans.PropertyChangeEvent)
public SensorPort getSensorPort()
getSensorPort()
and getPort()
.getPort()
public Port getPort()
getSensorPort()
and getPort()
.getPort()
public void update()
processEvent(SensorEvent)
,
SensorPeer.update()
,
SensorEvent
public double getPrecision()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |