|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
NullRequest | Line # 36 | 1 | 0% | 2 | 0 | 100% |
1.0
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
(2) | |||
Result | |||
1.0
|
org.perfectjpattern.core.behavioral.chainofresponsibility.TestExample.testChainOfResponsibility
![]() |
1 PASS | |
0.6666667
|
org.perfectjpattern.core.behavioral.chainofresponsibility.TestNullHandler.testExceptions
![]() |
1 PASS | |
1 | //---------------------------------------------------------------------- | |
2 | // | |
3 | // PerfectJPattern: "Design patterns are good but components are better!" | |
4 | // NullRequest.java Copyright (c) 2009 Giovanni Azua Garcia | |
5 | // bravegag@hotmail.com | |
6 | // | |
7 | // This program is free software; you can redistribute it and/or | |
8 | // modify it under the terms of the GNU General Public License | |
9 | // as published by the Free Software Foundation; either version 3 | |
10 | // of the License, or (at your option) any later version. | |
11 | // | |
12 | // This program is distributed in the hope that it will be useful, | |
13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | // GNU General Public License for more details. | |
16 | // | |
17 | // You should have received a copy of the GNU General Public License | |
18 | // along with this program; if not, see <http://www.gnu.org/licenses/>. | |
19 | // | |
20 | //---------------------------------------------------------------------- | |
21 | package org.perfectjpattern.core.api.behavioral.chainofresponsibility; | |
22 | ||
23 | import org.perfectjpattern.core.api.creational.singleton.ISingleton; | |
24 | ||
25 | /** | |
26 | * Null Object Pattern implementation of Chain of Responsibility | |
27 | * Request Parameter. | |
28 | * <br/><br/> | |
29 | * <code>NullRequest</code> is a Singleton therefore it may not be directly | |
30 | * instantiated, neither it may be extended. | |
31 | * | |
32 | * @author <a href="mailto:bravegag@hotmail.com">Giovanni Azua</a> | |
33 | * @version $Revision: 1.0 $ $Date: Nov 6, 2007 5:35:36 PM $ | |
34 | */ | |
35 | public final | |
36 | class NullRequest | |
37 | implements ISingleton | |
38 | { | |
39 | //------------------------------------------------------------------------ | |
40 | // public | |
41 | //------------------------------------------------------------------------ | |
42 | /** | |
43 | * Returns Singleton instance of <code>NullRequest</code>. | |
44 | * | |
45 | * @return Singleton instance of <code>NullRequest</code>. | |
46 | */ | |
47 | 9 |
![]() |
48 | getInstance() | |
49 | { | |
50 | 9 | return INSTANCE; |
51 | } | |
52 | ||
53 | //------------------------------------------------------------------------ | |
54 | // private | |
55 | //------------------------------------------------------------------------ | |
56 | 2 |
![]() |
57 | NullRequest() | |
58 | { | |
59 | // do nothing | |
60 | } | |
61 | ||
62 | //------------------------------------------------------------------------ | |
63 | // members | |
64 | //------------------------------------------------------------------------ | |
65 | /** | |
66 | * Singleton instance of <code>NullRequest</code> | |
67 | */ | |
68 | private static final NullRequest INSTANCE = new NullRequest(); | |
69 | } |
|