cz.zcu.fav.kiv.jsimcasestudies.watersystem.application
Class SourceMonitor

java.lang.Object
  |
  +--cz.zcu.fav.kiv.jsimcasestudies.watersystem.application.SourceMonitor

class SourceMonitor
extends java.lang.Object

An encapsulation of a water source data and functionality. This source code needn`t to be changed when passing it to the production version.

Version:
1.0 from 2004-03-20
Author:
Cesar ALLAIN, Jarda KACER, St.RACEK

Field Summary
private  CommonControlInterface controlInterface
          An interface between the controlled object and the control program
private  int sourceNumber
          Number of the source
 
Constructor Summary
protected SourceMonitor(CommonControlInterface controlInterface, int sourceNumber)
          Constructor of the class
 
Method Summary
protected  int getNumber()
          Gets the number of the source
protected  SourceState getSourceState()
          Synchronized method that returns consistent state of the source
protected  void pumpSwitchOff()
          Synchronized method that shows if the pump is switched off
protected  void pumpSwitchOn()
          Synchronized method that switches on the pump
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

controlInterface

private CommonControlInterface controlInterface
An interface between the controlled object and the control program


sourceNumber

private final int sourceNumber
Number of the source

Constructor Detail

SourceMonitor

protected SourceMonitor(CommonControlInterface controlInterface,
                        int sourceNumber)
Constructor of the class

Parameters:
controlInterface -
sourceNumber -
Method Detail

getNumber

protected int getNumber()
Gets the number of the source


pumpSwitchOn

protected void pumpSwitchOn()
Synchronized method that switches on the pump


pumpSwitchOff

protected void pumpSwitchOff()
Synchronized method that shows if the pump is switched off


getSourceState

protected SourceState getSourceState()
Synchronized method that returns consistent state of the source



Copyright © 2000-2004 University of West Bohemia, FAV-KIV. All Rights Reserved. Build date 20040510