| 
									
										
										
										
											2016-08-30 13:29:12 +02:00
										 |  |  | @startuml | 
					
						
							|  |  |  | package com.iluwatar.state { | 
					
						
							| 
									
										
										
										
											2016-09-18 17:51:09 +03:00
										 |  |  |   class PeacefulState { | 
					
						
							|  |  |  |     - mammoth : Mammoth | 
					
						
							|  |  |  |     + PeacefulState(mammoth : Mammoth) | 
					
						
							|  |  |  |     + observe() | 
					
						
							|  |  |  |     + onEnterState() | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   interface State { | 
					
						
							|  |  |  |     + observe() {abstract} | 
					
						
							|  |  |  |     + onEnterState() {abstract} | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   class App { | 
					
						
							|  |  |  |     + App() | 
					
						
							|  |  |  |     + main(args : String[]) {static} | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2016-08-30 13:29:12 +02:00
										 |  |  |   class AngryState { | 
					
						
							|  |  |  |     - mammoth : Mammoth | 
					
						
							|  |  |  |     + AngryState(mammoth : Mammoth) | 
					
						
							|  |  |  |     + observe() | 
					
						
							|  |  |  |     + onEnterState() | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   class Mammoth { | 
					
						
							|  |  |  |     - state : State | 
					
						
							|  |  |  |     + Mammoth() | 
					
						
							|  |  |  |     - changeStateTo(newState : State) | 
					
						
							|  |  |  |     + observe() | 
					
						
							|  |  |  |     + timePasses() | 
					
						
							|  |  |  |     + toString() : String | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | AngryState -->  "-mammoth" Mammoth | 
					
						
							| 
									
										
										
										
											2016-09-18 17:51:09 +03:00
										 |  |  | PeacefulState -->  "-mammoth" Mammoth | 
					
						
							| 
									
										
										
										
											2016-08-30 13:29:12 +02:00
										 |  |  | Mammoth -->  "-state" State | 
					
						
							|  |  |  | PeacefulState ..|> State  | 
					
						
							| 
									
										
										
										
											2016-09-18 17:51:09 +03:00
										 |  |  | AngryState ..|> State  | 
					
						
							| 
									
										
										
										
											2016-08-30 13:29:12 +02:00
										 |  |  | @enduml |