Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
11   63   8   1.57
2   33   0.73   7
7     1.14  
1    
 
  AbstractState       Line # 10 11 8 100% 1.0
 
  (144)
 
1    package org.qedeq.kernel.se.state;
2   
3    import 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    */
 
10    public 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  873 toggle protected AbstractState(final String text, final boolean failure, final int code) {
30  873 this.text = text;
31  873 if (this.text == null) {
32  1 throw new IllegalArgumentException("text==null");
33    }
34  872 this.failure = failure;
35  872 this.code = code;
36    }
37   
 
38  101 toggle public String getText() {
39  101 return this.text;
40    }
41   
 
42  5552 toggle public boolean isFailure() {
43  5552 return this.failure;
44    }
45   
 
46  3293 toggle public int getCode() {
47  3293 return this.code;
48    }
49   
 
50  35 toggle public String toString() {
51  35 return this.text;
52    }
53   
 
54  35 toggle public int hashCode() {
55  35 return this.text.hashCode();
56    }
57   
 
58  64 toggle public boolean equals(final Object obj) {
59    // every instance is unique
60  64 return (this == obj);
61    }
62   
63    }