Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Sa Jan 26 2008 14:11:34 CET
file stats: LOC: 127   Methods: 7
NCLOC: 50   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
LogicalState.java 50% 54,5% 42,9% 50%
coverage coverage
 1    /* $Id: LogicalState.java,v 1.4 2008/01/26 12:39:09 m31 Exp $
 2    *
 3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
 4    *
 5    * Copyright 2000-2007, Michael Meyling <mime@qedeq.org>.
 6    *
 7    * "Hilbert II" is free software; you can redistribute
 8    * it and/or modify it under the terms of the GNU General Public
 9    * License as published by the Free Software Foundation; either
 10    * version 2 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   
 18    package org.qedeq.kernel.bo.module;
 19   
 20   
 21    /**
 22    * Represents a mathematical module state. Every instance of this class is unique.
 23    *
 24    * @version $Revision: 1.4 $
 25    * @author Michael Meyling
 26    */
 27    public final class LogicalState {
 28   
 29    /** Unchecked. */
 30    public static final LogicalState STATE_UNCHECKED
 31    = new LogicalState(LogicalStateDescriptions.STATE_STRING_UNCHECKED,
 32    false, LogicalStateDescriptions.STATE_CODE_UNCHECKED);
 33   
 34    /** External checking. */
 35    public static final LogicalState STATE_EXTERNAL_CHECKING
 36    = new LogicalState(LogicalStateDescriptions.STATE_STRING_EXTERNAL_CHECKING,
 37    false, LogicalStateDescriptions.STATE_CODE_EXTERNAL_CHECKING);
 38   
 39    /** Successfully created. */
 40    public static final LogicalState STATE_EXTERNAL_CHECKING_FAILED
 41    = new LogicalState(LogicalStateDescriptions.STATE_STRING_EXTERNAL_CHECKING_FAILED,
 42    true, LogicalStateDescriptions.STATE_CODE_EXTERNAL_CHECKING_FAILED);
 43   
 44    /** Internal checking phase. */
 45    public static final LogicalState STATE_INTERNAL_CHECKING
 46    = new LogicalState(LogicalStateDescriptions.STATE_STRING_INTERNAL_CHECKING,
 47    false, LogicalStateDescriptions.STATE_CODE_INTERNAL_CHECKING);
 48   
 49    /** Internal check failed. */
 50    public static final LogicalState STATE_INTERNAL_CHECKING_FAILED
 51    = new LogicalState(LogicalStateDescriptions.STATE_STRING_INTERNAL_CHECKING_FAILED,
 52    true, LogicalStateDescriptions.STATE_CODE_INTERNAL_CHECKING_FAILED);
 53   
 54   
 55    /** Successfully completely checked. */
 56    public static final LogicalState STATE_CHECKED
 57    = new LogicalState(LogicalStateDescriptions.STATE_STRING_COMPLETELY_CHECKED,
 58    false, LogicalStateDescriptions.STATE_CODE_COMPLETELY_CHECKED);
 59   
 60   
 61    /** meaning of this state. */
 62    private final String text;
 63   
 64    /** is this state a failure? */
 65    private final boolean failure;
 66   
 67    /** Code for state. */
 68    private final int code;
 69   
 70    /**
 71    * Creates new module state.
 72    *
 73    * @param text meaning of this state, <code>null</code> is not permitted.
 74    * @param failure is this a failure state?
 75    * @param code code of this state.
 76    * @throws IllegalArgumentException text == <code>null</code>
 77    */
 78  24 private LogicalState(final String text, final boolean failure, final int code) {
 79  24 this.text = text;
 80  24 if (this.text == null) {
 81  0 throw new IllegalArgumentException("text==null");
 82    }
 83  24 this.failure = failure;
 84  24 this.code = code;
 85    }
 86   
 87    /**
 88    * Get meaning of module state.
 89    *
 90    * @return meaning of module state.
 91    */
 92  181 public String getText() {
 93  181 return this.text;
 94    }
 95   
 96    /**
 97    * Is this a failure state?
 98    *
 99    * @return is this a failure state?
 100    */
 101  1046 public boolean isFailure() {
 102  1046 return this.failure;
 103    }
 104   
 105    /**
 106    * Get module state code.
 107    *
 108    * @return Module state.
 109    */
 110  0 public int getCode() {
 111  0 return this.code;
 112    }
 113   
 114  0 public String toString() {
 115  0 return this.text;
 116    }
 117   
 118  0 public int hashCode() {
 119  0 return this.text.hashCode();
 120    }
 121   
 122  0 public boolean equals(final Object obj) {
 123    // every instance is unique
 124  0 return (this == obj);
 125    }
 126   
 127    }