提交 6b843f02 编写于 作者: I Ilkka Seppala

Commented chain of responsibility example.

上级 1cdb5935
package com.iluwatar; package com.iluwatar;
/**
*
* Chain of Responsibility organizes request handlers (RequestHandler) into
* a chain where each handler has a chance to act on the request on its
* turn. In this example the king (OrcKing) makes requests and the military
* orcs (OrcCommander, OrcOfficer, OrcSoldier) form the handler chain.
*
*/
public class App public class App
{ {
public static void main( String[] args ) public static void main( String[] args )
......
package com.iluwatar; package com.iluwatar;
/**
*
* Makes requests that are handled by the chain.
*
*/
public class OrcKing { public class OrcKing {
RequestHandler chain; RequestHandler chain;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册