EMMA Coverage Report (generated Fri Feb 14 08:28:31 UTC 2014)
[all classes][org.qedeq.kernel.se.state]

COVERAGE SUMMARY FOR SOURCE FILE [AbstractState.java]

nameclass, %method, %block, %line, %
AbstractState.java100% (1/1)100% (7/7)100% (43/43)100% (13/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AbstractState100% (1/1)100% (7/7)100% (43/43)100% (13/13)
AbstractState (String, boolean, int): void 100% (1/1)100% (20/20)100% (7/7)
equals (Object): boolean 100% (1/1)100% (7/7)100% (1/1)
getCode (): int 100% (1/1)100% (3/3)100% (1/1)
getText (): String 100% (1/1)100% (3/3)100% (1/1)
hashCode (): int 100% (1/1)100% (4/4)100% (1/1)
isFailure (): boolean 100% (1/1)100% (3/3)100% (1/1)
toString (): String 100% (1/1)100% (3/3)100% (1/1)

1package org.qedeq.kernel.se.state;
2 
3import org.qedeq.kernel.se.common.State;
4 
5/**
6 * Represents a module state. All existing instances of this class should be unique.
7 *
8 * @author  Michael Meyling
9 */
10public abstract class AbstractState implements State {
11 
12    /** Meaning of this state. */
13    private final String text;
14 
15    /** Is this state a failure? */
16    private final boolean failure;
17 
18    /** Code for state. */
19    private final int code;
20 
21    /**
22     * Creates new module state.
23     *
24     * @param   text    meaning of this state, <code>null</code> is not permitted.
25     * @param   failure is this a failure state?
26     * @param   code    code of this state.
27     * @throws  IllegalArgumentException    text == <code>null</code>
28     */
29    protected AbstractState(final String text, final boolean failure, final int code) {
30        this.text = text;
31        if (this.text == null) {
32            throw new IllegalArgumentException("text==null");
33        }
34        this.failure = failure;
35        this.code = code;
36    }
37 
38    public String getText() {
39        return this.text;
40    }
41 
42    public boolean isFailure() {
43        return this.failure;
44    }
45 
46    public int getCode() {
47        return this.code;
48    }
49 
50    public String toString() {
51        return this.text;
52    }
53 
54    public int hashCode() {
55        return this.text.hashCode();
56    }
57 
58    public boolean equals(final Object obj) {
59        // every instance is unique
60        return (this == obj);
61    }
62 
63}

[all classes][org.qedeq.kernel.se.state]
EMMA 2.1.5320 (stable) (C) Vladimir Roubtsov