Skip to content

RGlessing/ceiling-fan-state-design-pattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ceiling Fan Using State Design Pattern

Overview

This project is intended to simulate a ceiling fan using the state design pattern. The fan has two chains that are used to change its speed and direction. The fan has four speed states, which are off, low, medium, and high. Pulling the speed chain will change the fan's speed to the next state in the order given. If it is in the high state, then the fan will return to the off state. The fan has two direction states, clockwise and counterclockwise. Pulling the direction chain will alternate the fan's direction between clockwise and counterclockwise.

Build

This project can be built from the command line by entering the commands listed below:

  • sudo dnf install maven
  • mvn clean compile assembly:single
  • java -jar target/ceiling-fan-state-design-pattern-1.0-SNAPSHOT-jar-with-dependencies.jar

Testing

jUnit4 was used to unit test this project. Tests can be found here.

Demo

This project has a main method used only for demonstration. It cycles through each of the speed and direction states. It can be found here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages