Question: * * Template Developed by Sotirios Liaskos for the needs of * ITEC 3 0 3 0 Systems Architecture. * @ All Rights Reserved *
Template Developed by Sotirios Liaskos for the needs of
ITEC Systems Architecture.
@ All Rights Reserved
package itecassignments.a;
import java.util.ArrayList;
import itecsmarthome.standards.;
A Room object for maintaining room information.
@author Sotirios
public class Room
private String name "default";
private ArrayList tempSensors new ArrayList;
The name of the Room eg Living Room
@return The name of the room
public String getName
return name;
The name of the Room eg Living Room
@param name The name of the room.
public void setNameString name
this.name name;
ROOM SETUP
Use this function to install a temperature sensor to the room.
@param t Reference to an object that implements xxx
public void install t
tempSensors.addt;
OFFER ROOM INFORMATION
Returns the average temperature readings of the sensors installed in the room.
@return The average temperature of the room according to the sensors installed in it
public float getAvergeTemperature
float count ;
float sum ;
for s : tempSensors
sum sgetReading;
count;
returnfloatsumcount;
Returns true if an object implementing a xxx interface is found in the room.
@param s Reference to an object that implements xxx
@return True if the object is installed in the room. Currently checks only the collection of temperature sensors
public boolean hasThing s
boolean found false;
for t : tempSensors
if tequalss found true;
Collection of other types can be added here.
return found;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
