Improved comments for state pattern.
This commit is contained in:
		@@ -1,5 +1,10 @@
 | 
			
		||||
package com.iluwatar;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 
 | 
			
		||||
 * Angry state.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
public class AngryState implements State {
 | 
			
		||||
 | 
			
		||||
	private Mammoth mammoth;
 | 
			
		||||
 
 | 
			
		||||
@@ -2,10 +2,12 @@ package com.iluwatar;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 
 | 
			
		||||
 * In State pattern the object (Mammoth) has internal state object (State) that
 | 
			
		||||
 * In State pattern the container object (Mammoth) has an internal state object (State) that
 | 
			
		||||
 * defines the current behavior. The state object can be changed to alter the
 | 
			
		||||
 * behavior.
 | 
			
		||||
 * 
 | 
			
		||||
 * In this example the mammoth changes its behavior as time passes by.
 | 
			
		||||
 * 
 | 
			
		||||
 */
 | 
			
		||||
public class App {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,10 @@
 | 
			
		||||
package com.iluwatar;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 
 | 
			
		||||
 * Peaceful state.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
public class PeacefulState implements State {
 | 
			
		||||
 | 
			
		||||
	private Mammoth mammoth;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user