|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
IsNot.java | - | 66.7% | 66.7% | 66.7% |
|
1 |
/* Copyright (c) 2000-2003, jMock.org. See bundled LICENSE.txt */
|
|
2 |
package org.jmock.constraint;
|
|
3 |
|
|
4 |
import org.jmock.Constraint;
|
|
5 |
|
|
6 |
/**
|
|
7 |
* Calculates the logical negation of a constraint.
|
|
8 |
*/
|
|
9 |
public class IsNot implements Constraint { |
|
10 |
private Constraint _predicate;
|
|
11 |
|
|
12 | 28 |
public IsNot(Constraint p) {
|
13 | 28 |
_predicate = p; |
14 |
} |
|
15 |
|
|
16 | 6 |
public boolean eval(Object arg) { |
17 | 6 |
return !_predicate.eval(arg);
|
18 |
} |
|
19 |
|
|
20 | 0 |
public String toString() {
|
21 | 0 |
return "not " + _predicate; |
22 |
} |
|
23 |
} |
|
24 |
|
|