资源简介

设计模式之状态模式实例,用Java实现,副讲解 设计模式之状态模式实例,用Java实现,副讲解 设计模式之状态模式实例,用Java实现,副讲解

资源截图

代码片段和文件信息

package com.pattern.state.client;

import com.pattern.state.context.Work;

public class Client {
public static void main(String[] args) {
Work work =new Work();
work.setHour(9);
work.doSomeWork();

work.setHour(14);
work.doSomeWork();

work.setHour(18);
work.doSomeWork();

work.setHour(21);
//完成工作了
work.setFinish(true);
work.doSomeWork();

work.setHour(24);
work.doSomeWork();
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         301  2017-09-06 11:49  StatePatternDemo\.classpath
     文件         392  2017-09-06 11:49  StatePatternDemo\.project
     文件         598  2017-09-06 11:49  StatePatternDemo\.settings\org.eclipse.jdt.core.prefs
     文件        5679  2017-09-07 09:39  StatePatternDemo\bin\StatePattern.umr
     文件        5664  2017-09-07 09:38  StatePatternDemo\bin\StatePattern.umr~
     文件         744  2017-09-07 09:17  StatePatternDemo\bin\com\pattern\state\client\Client.class
     文件        1117  2017-09-07 09:17  StatePatternDemo\bin\com\pattern\state\context\Work.class
     文件        1123  2017-09-07 09:17  StatePatternDemo\bin\com\pattern\state\state\AMState.class
     文件        1164  2017-09-07 09:17  StatePatternDemo\bin\com\pattern\state\state\EndWorkState.class
     文件        1263  2017-09-07 09:17  StatePatternDemo\bin\com\pattern\state\state\NightState.class
     文件        1123  2017-09-07 09:17  StatePatternDemo\bin\com\pattern\state\state\PMState.class
     文件         930  2017-09-07 09:17  StatePatternDemo\bin\com\pattern\state\state\SleepState.class
     文件         347  2017-09-07 09:17  StatePatternDemo\bin\com\pattern\state\state\State.class
     文件        5679  2017-09-07 09:39  StatePatternDemo\src\StatePattern.umr
     文件        5664  2017-09-07 09:38  StatePatternDemo\src\StatePattern.umr~
     文件         449  2017-09-06 18:00  StatePatternDemo\src\com\pattern\state\client\Client.java
     文件         760  2017-09-06 16:16  StatePatternDemo\src\com\pattern\state\context\Work.java
     文件         375  2017-09-06 16:06  StatePatternDemo\src\com\pattern\state\state\AMState.java
     文件         388  2017-09-06 17:42  StatePatternDemo\src\com\pattern\state\state\EndWorkState.java
     文件         495  2017-09-06 17:58  StatePatternDemo\src\com\pattern\state\state\NightState.java
     文件         374  2017-09-06 16:06  StatePatternDemo\src\com\pattern\state\state\PMState.java
     文件         270  2017-09-06 16:06  StatePatternDemo\src\com\pattern\state\state\SleepState.java
     文件         186  2017-09-06 16:06  StatePatternDemo\src\com\pattern\state\state\State.java

评论

共有 条评论