Class Thermometer.Channel

  • Enclosing class:
    Thermometer

    private class Thermometer.Channel
    extends java.lang.Object
    Class to hold data for a specified channel including the location, temperature and the last time data was received for this channel.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int channel
      Channel number of this channel
      private java.lang.String location
      Location of this channel
      private java.lang.String temperature
      Last temperature received for this channel, default is -40 degrees
      private long time
      Time in millis since epoch that the last temperature was received for this channel
    • Constructor Summary

      Constructors 
      Constructor Description
      Channel​(int channel)
      Create a new Channel object with the specified channel number
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getChannel()
      Get the channel number of this channel
      java.lang.String getLocation()
      Get the location of this channel
      java.lang.String getTemp()
      Get the latest temperature reported for this channel
      long getTime()
      Get the time of the last temperature update
      void setLocation​(java.lang.String location)
      Set the location of this channel
      void setTemp​(java.lang.String temperature)
      Set the temperature for this channel and update the time
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • channel

        private final int channel
        Channel number of this channel
      • location

        private java.lang.String location
        Location of this channel
      • temperature

        private java.lang.String temperature
        Last temperature received for this channel, default is -40 degrees
      • time

        private long time
        Time in millis since epoch that the last temperature was received for this channel
    • Constructor Detail

      • Channel

        public Channel​(int channel)
        Create a new Channel object with the specified channel number
        Parameters:
        channel - channel number
    • Method Detail

      • getChannel

        public int getChannel()
        Get the channel number of this channel
        Returns:
        channel number of this channel
      • getLocation

        public java.lang.String getLocation()
        Get the location of this channel
        Returns:
        location of this channel
      • getTemp

        public java.lang.String getTemp()
        Get the latest temperature reported for this channel
        Returns:
        latest reported temperature
      • getTime

        public long getTime()
        Get the time of the last temperature update
        Returns:
        time of the last temperature update
      • setLocation

        public void setLocation​(java.lang.String location)
        Set the location of this channel
        Parameters:
        location - to be set
      • setTemp

        public void setTemp​(java.lang.String temperature)
        Set the temperature for this channel and update the time
        Parameters:
        temperature - to be set