project1
Class Machine

java.lang.Object
  |
  +--project1.Machine

public class Machine
extends java.lang.Object


Constructor Summary
Machine()
          Class constructor
Machine(java.lang.String model, java.lang.String manufacturer)
          Class constructor that sets modelName and manufacturer
Machine(java.lang.String model, java.lang.String manufacturer, int voltage)
          Class constructor that sets modelName, manufacturer and working voltage
Machine(java.lang.String model, java.lang.String manufacturer, int voltage, java.lang.String n)
          Class constructor that sets modelName, manufacturer, working voltage and name field
 
Method Summary
 void operate()
          Operates the machine if it available
 void operate(java.util.Date date, Time tStart, Time tEnd)
          Operates the machine if it available.
 void pause()
          pauses the machine
 void printmode()
          prints the current mode of the machine
 void reserve(java.util.Date date, Time tStart, Time tEnd)
          Reserves the machine for a future use.
 void stop()
          stops the machine
 void turnonoff()
          turns the machine if it is off or turns the machine on if it is on
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Machine

public Machine()
Class constructor


Machine

public Machine(java.lang.String model,
               java.lang.String manufacturer)
Class constructor that sets modelName and manufacturer


Machine

public Machine(java.lang.String model,
               java.lang.String manufacturer,
               int voltage)
Class constructor that sets modelName, manufacturer and working voltage


Machine

public Machine(java.lang.String model,
               java.lang.String manufacturer,
               int voltage,
               java.lang.String n)
Class constructor that sets modelName, manufacturer, working voltage and name field

Method Detail

operate

public void operate()
             throws NotReadyException
Operates the machine if it available

NotReadyException

operate

public void operate(java.util.Date date,
                    Time tStart,
                    Time tEnd)
             throws NotReadyException
Operates the machine if it available. Throws NotReadyException when the machine is not ready

Parameters:
date - day,month and year of the operating time
tStart - operation start time (hour,minutes and seconds)
tEnd - operation end time (hour,minutes and seconds)
NotReadyException

stop

public void stop()
stops the machine


pause

public void pause()
pauses the machine


turnonoff

public void turnonoff()
turns the machine if it is off or turns the machine on if it is on


reserve

public void reserve(java.util.Date date,
                    Time tStart,
                    Time tEnd)
             throws NotReadyException
Reserves the machine for a future use. Throws NotReadyException when the machine is not ready

Parameters:
date - day,month and year of the operating time
tStart - operation start time (hour,minutes and seconds)
tEnd - operation end time (hour,minutes and seconds)
NotReadyException

printmode

public void printmode()
prints the current mode of the machine