Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb014dc2

Browse files
committed
Grammar fixes to state pattern
1 parent9a2c5aa commitb014dc2

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

‎state/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ change its class.
2020

2121
##Explanation
2222

23-
Realworld example
23+
Real-world example
2424

2525
>When observing a mammoth in its natural habitat it seems to change its behavior based on the
26-
>situation. It may first appear calm but over time when it detects a threat it gets angry and
26+
>situation. It may first appear calm, but over time when it detects a threat, it gets angry and
2727
>dangerous to its surroundings.
2828
2929
In plain words
@@ -125,7 +125,7 @@ public class Mammoth {
125125
}
126126
```
127127

128-
And hereis the full example how the mammoth behaves over time.
128+
Hereis the full example of how the mammoth behaves over time.
129129

130130
```java
131131
var mammoth=newMammoth();
@@ -156,7 +156,7 @@ Use the State pattern in either of the following cases
156156
* An object's behavior depends on its state, and it must change its behavior at run-time depending on that state
157157
* Operations have large, multipart conditional statements that depend on the object's state. This state is usually represented by one or more enumerated constants. Often, several operations will contain this same conditional structure. The State pattern puts each branch of the conditional in a separate class. This lets you treat the object's state as an object in its own right that can vary independently from other objects.
158158

159-
##Real world examples
159+
##Known uses
160160

161161
*[javax.faces.lifecycle.Lifecycle#execute()](http://docs.oracle.com/javaee/7/api/javax/faces/lifecycle/Lifecycle.html#execute-javax.faces.context.FacesContext-) controlled by[FacesServlet](http://docs.oracle.com/javaee/7/api/javax/faces/webapp/FacesServlet.html), the behavior is dependent on current phase of lifecycle.
162162
*[JDiameter - Diameter State Machine](https://github.com/npathai/jdiameter/blob/master/core/jdiameter/api/src/main/java/org/jdiameter/api/app/State.java)

‎state/src/main/java/com/iluwatar/state/App.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
packagecom.iluwatar.state;
2525

2626
/**
27-
* In State pattern the container object has an internal state object that defines the current
27+
* IntheState pattern, the container object has an internal state object that defines the current
2828
* behavior. The state object can be changed to alter the behavior.
2929
*
3030
* <p>This can be a cleaner way for an object to change its behavior at runtime without resorting

‎state/src/main/java/com/iluwatar/state/State.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,4 @@ public interface State {
3131
voidonEnterState();
3232

3333
voidobserve();
34-
3534
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp