FileDocCategorySizeDatePackage
TemperaturePulseEvent.javaAPI DocExample889Tue Jun 03 23:54:42 BST 1997BeansBook.Simulator

TemperaturePulseEvent.java

// This example is from the book Developing Java Beans by Robert Englander. 
// Copyright (c) 1997 O'Reilly & Associates.
// You may study, use, modify, and distribute this example for any purpose.
// This example is provided WITHOUT WARRANTY either expressed or implied.

// Chapter 8 -- The TemperaturePulseEvent class

package BeansBook.Simulator;

// class definition for the temperature pulse event
public class TemperaturePulseEvent
        extends java.util.EventObject
{
   // the pulse temperature
   protected double theTemp;
   
   // constructor
   public TemperaturePulseEvent(Object source, double t)
   {
      // pass the source to the superclass
      super(source);
      
      // save the temperature
      theTemp = t;
   }
   
   // return the pulse temperature
   public double getPulseTemperature()
   {
      return theTemp;
   }
}