Class AbstractActionDeviceState
- java.lang.Object
-
- cz.cvut.fel.omo.SmartHome.devices.AbstractState
-
- cz.cvut.fel.omo.SmartHome.devices.action.states.AbstractActionDeviceState
-
- Direct Known Subclasses:
ActionDeviceBrokenState
,ActionDeviceBusyState
,ActionDeviceOffState
,ActionDeviceOnState
,SportDeviceBrokenState
,SportDeviceNotUsedState
,SportDeviceUsedState
public abstract class AbstractActionDeviceState extends AbstractState
Abstract class for implementing the state pattern
-
-
Constructor Summary
Constructors Constructor Description AbstractActionDeviceState()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
action(AbstractActionDevice deviceUsable, Creature person)
The method implemented by the state pattern.abstract boolean
isFree()
The method determines if the device is not occupied by any person.-
Methods inherited from class cz.cvut.fel.omo.SmartHome.devices.AbstractState
consume
-
-
-
-
Method Detail
-
action
public abstract void action(AbstractActionDevice deviceUsable, Creature person)
The method implemented by the state pattern. Depending on the state of the device, a different interaction of the device with a person is performed.- Parameters:
deviceUsable
- Device with which a person interacts.person
- A person who interacts with device.
-
isFree
public abstract boolean isFree()
The method determines if the device is not occupied by any person.- Returns:
-
-