EasyMock 2.3

Clover coverage report - EasyMock 2.3
Coverage timestamp: mar. juil. 10 2007 02:46:04 CEST
FRAMES NO FRAMES

file stats: | LOC: | 39 |  | Methods: | 3
| NCLOC: | 28 |  | Classes: | 1

Source file | Conditionals | Statements | Methods | TOTAL

And.java

100%

100%

100%

100%

1 |  | /*
2 |  | * Copyright (c) 2001-2007 OFFIS, Tammo Freese.
3 |  | * This program is made available under the terms of the MIT License.
4 |  | */
5 |  | package org.easymock.internal.matchers;
6 |  |
7 |  | import java.util.Iterator;
8 |  | import java.util.List;
9 |  |
10 |  | import org.easymock.IArgumentMatcher;
11 |  |
12 |  | public class And implements IArgumentMatcher {
13 |  |
14 |  | private final List<IArgumentMatcher> matchers;
15 |  |
16 | 12 | public And(List<IArgumentMatcher> matchers) {
17 | 12 | this.matchers = matchers;
18 |  | }
19 |  |
20 | 17 | public boolean matches(Object actual) {
21 | 17 | for (IArgumentMatcher matcher : matchers) {
22 | 34 | if (!matcher.matches(actual)) {
23 | 2 | return false;
24 |  | }
25 |  | }
26 | 15 | return true;
27 |  | }
28 |  |
29 | 4 | public void appendTo(StringBuffer buffer) {
30 | 4 | buffer.append("and(");
31 | 4 | for (Iterator<IArgumentMatcher> it = matchers.iterator(); it.hasNext();) {
32 | 8 | it.next().appendTo(buffer);
33 | 8 | if (it.hasNext()) {
34 | 4 | buffer.append(", ");
35 |  | }
36 |  | }
37 | 4 | buffer.append(")");
38 |  | }
39 |  | }