forked from rick2785/JavaCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChain.java
More file actions
19 lines (13 loc) · 515 Bytes
/
Chain.java
File metadata and controls
19 lines (13 loc) · 515 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// The chain of responsibility pattern has a
// group of objects that are expected to between
// them be able to solve a problem.
// If the first Object can't solve it, it passes
// the data to the next Object in the chain
public interface Chain {
// Defines the next Object to receive the data
// if this Object can't process it
public void setNextChain(Chain nextChain);
// Either solves the problem or passes the data
// to the next Object in the chain
public void calculate(Numbers request);
}