edu.nau.cs.scu
Class TempSensor

java.lang.Object
  extended by edu.nau.cs.scu.TempSensor

public class TempSensor
extends java.lang.Object

This class serves as a stand-in for simulating the temperature sensors on the device. Temperature at the moment is non-changing and is set when initializing the sensor. This class could be expanded for more realistic temperature simulation at a later date.

Author:
Bernard Jzexoia Avery

Constructor Summary
TempSensor(double t)
          Initialize the sensor with a temperature value.
 
Method Summary
 double getTemperature()
          Return the current temperature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TempSensor

public TempSensor(double t)
Initialize the sensor with a temperature value.

Parameters:
t - The temperature which the sensor will always return.
Method Detail

getTemperature

public double getTemperature()
Return the current temperature. This method will ensure that the temperature falls within a valid range.

Returns:
the current temperature truncated to the valid range of the sensor.