Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lsh
patterns
提交
92a1ee11
P
patterns
项目概览
lsh
/
patterns
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
patterns
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
92a1ee11
编写于
10月 13, 2021
作者:
C
chenjianqiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.更新md文件说明
上级
00224b24
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
25 addition
and
12 deletion
+25
-12
.idea/workspace.xml
.idea/workspace.xml
+9
-3
README.md
README.md
+9
-2
src/com/chen/InterpreterPattern/po/InterpreterMain.java
src/com/chen/InterpreterPattern/po/InterpreterMain.java
+1
-1
src/com/chen/PatternApplication.java
src/com/chen/PatternApplication.java
+1
-2
src/com/chen/StrategyPattern/po/Context.java
src/com/chen/StrategyPattern/po/Context.java
+1
-1
src/com/chen/StrategyPattern/po/StrategyMain.java
src/com/chen/StrategyPattern/po/StrategyMain.java
+4
-3
未找到文件。
.idea/workspace.xml
浏览文件 @
92a1ee11
...
...
@@ -2,8 +2,11 @@
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"e43e9168-5945-4f45-b4c2-1b6410d1eef8"
name=
"Changes"
comment=
"增加策略模式案例 Signed-off-by: chenjianqiang <wushanxi@gmail.com>"
>
<change
beforePath=
"$PROJECT_DIR$/README.md"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/README.md"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/com/chen/InterpreterPattern/InterpreterMain.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/com/chen/InterpreterPattern/po/InterpreterMain.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/com/chen/PatternApplication.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/com/chen/PatternApplication.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/com/chen/PatternMain.java"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/com/chen/StrategyPattern/Context.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/com/chen/StrategyPattern/po/Context.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/com/chen/StrategyPattern/StrategyMain.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/com/chen/StrategyPattern/po/StrategyMain.java"
afterDir=
"false"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
...
...
@@ -88,10 +91,13 @@
</component>
<component
name=
"PropertiesComponent"
>
<property
name=
"WebServerToolWindowFactoryState"
value=
"false"
/>
<property
name=
"last_opened_file_path"
value=
"$PROJECT_DIR$"
/>
<property
name=
"last_opened_file_path"
value=
"$PROJECT_DIR$
/src/com/chen/StrategyPattern
"
/>
<property
name=
"vue.rearranger.settings.migration"
value=
"true"
/>
</component>
<component
name=
"RecentsManager"
>
<key
name=
"CopyFile.RECENT_KEYS"
>
<recent
name=
"E:\chen\patterns\src\com\chen\StrategyPattern"
/>
</key>
<key
name=
"CopyClassDialog.RECENTS_KEY"
>
<recent
name=
"com.chen.StrategyPattern.po"
/>
<recent
name=
"com.company.InterpreterPattern"
/>
...
...
@@ -126,7 +132,7 @@
<workItem
from=
"1634085227295"
duration=
"1967000"
/>
<workItem
from=
"1634087918450"
duration=
"3646000"
/>
<workItem
from=
"1634091679401"
duration=
"1323000"
/>
<workItem
from=
"1634093719115"
duration=
"
2735
000"
/>
<workItem
from=
"1634093719115"
duration=
"
3683
000"
/>
</task>
<task
id=
"LOCAL-00001"
summary=
"增加策略模式案例 Signed-off-by: chenjianqiang <wushanxi@gmail.com>"
>
<created>
1634096220780
</created>
...
...
README.md
浏览文件 @
92a1ee11
#
p
atterns
#
P
atterns
设计模式学习案例
\ No newline at end of file
### 快速上手
PatternApplication --->>> main()
### 包说明
```
--examples 贡献用户的真实业务代码案例
--po 网络平台的解释文字介绍和代码案例
```
src/com/chen/InterpreterPattern/InterpreterMain.java
→
src/com/chen/InterpreterPattern/
po/
InterpreterMain.java
浏览文件 @
92a1ee11
package
com.chen.InterpreterPattern
;
package
com.chen.InterpreterPattern
.po
;
import
com.chen.InterpreterPattern.po.AndExpression
;
import
com.chen.InterpreterPattern.po.Expression
;
...
...
src/com/chen/PatternApplication.java
浏览文件 @
92a1ee11
package
com.chen
;
import
com.chen.InterpreterPattern.InterpreterMain
;
import
com.chen.StrategyPattern.StrategyMain
;
import
com.chen.StrategyPattern.po.StrategyMain
;
/**
* @author lx
...
...
src/com/chen/StrategyPattern/Context.java
→
src/com/chen/StrategyPattern/
po/
Context.java
浏览文件 @
92a1ee11
package
com.chen.StrategyPattern
;
package
com.chen.StrategyPattern
.po
;
import
com.chen.StrategyPattern.po.Strategy
;
...
...
src/com/chen/StrategyPattern/StrategyMain.java
→
src/com/chen/StrategyPattern/
po/
StrategyMain.java
浏览文件 @
92a1ee11
package
com.chen.StrategyPattern
;
package
com.chen.StrategyPattern
.po
;
import
com.chen.StrategyPattern.po.Context
;
import
com.chen.StrategyPattern.po.OperationA
;
import
com.chen.StrategyPattern.po.OperationB
;
...
...
@@ -13,11 +14,11 @@ public class StrategyMain {
int
a
=
5
;
int
b
=
11
;
// 策略A
Context
c
=
new
Context
(
new
OperationA
());
System
.
err
.
println
(
c
.
exec
(
a
,
b
));
// 策略B
c
=
new
Context
(
new
OperationB
());
System
.
err
.
println
(
c
.
exec
(
a
,
b
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录