Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Mai 10 2007 03:16:40 CEST
file stats: LOC: 138   Methods: 7
NCLOC: 53   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
MathematicalState.java 0% 0% 0% 0%
coverage
 1    /* $Id: MathematicalState.java,v 1.1 2007/04/01 07:59:48 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.
 23    *
 24    * @version $Revision: 1.1 $
 25    * @author Michael Meyling
 26    */
 27    public final class MathematicalState {
 28   
 29    /** Unchecked. */
 30    public static final MathematicalState STATE_UNCHECKED
 31    = new MathematicalState(MathematicalStateDescriptions.STATE_STRING_UNCHECKED,
 32    false, MathematicalStateDescriptions.STATE_CODE_UNCHECKED);
 33   
 34    /** External checking. */
 35    public static final MathematicalState STATE_EXTERNAL_CHECKING
 36    = new MathematicalState(MathematicalStateDescriptions.STATE_STRING_EXTERNAL_CHECKING,
 37    false, MathematicalStateDescriptions.STATE_CODE_EXTERNAL_CHECKING);
 38   
 39    /** Successfully created. */
 40    public static final MathematicalState STATE_EXTERNAL_CHECK_FAILED
 41    = new MathematicalState(MathematicalStateDescriptions.STATE_STRING_EXTERNAL_CHECK_FAILED,
 42    true, MathematicalStateDescriptions.STATE_CODE_EXTERNAL_CHECK_FAILED);
 43   
 44    /** Internal checking phase. */
 45    public static final MathematicalState STATE_INTERNAL_CHECKING
 46    = new MathematicalState(MathematicalStateDescriptions.STATE_STRING_INTERNAL_CHECKING,
 47    false, MathematicalStateDescriptions.STATE_CODE_INTERNAL_CHECKING);
 48   
 49    /** Internal check failed. */
 50    public static final MathematicalState STATE_INTERNAL_CHECK_FAILED
 51    = new MathematicalState(MathematicalStateDescriptions.STATE_STRING_INTERNAL_CHECK_FAILED,
 52    true, MathematicalStateDescriptions.STATE_CODE_INTERNAL_CHECK_FAILED);
 53   
 54   
 55    /** Successfully completely checked. */
 56    public static final MathematicalState STATE_CHECKED
 57    = new MathematicalState(MathematicalStateDescriptions.STATE_STRING_COMPLETELY_CHECKED,
 58    false, MathematicalStateDescriptions.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  0 private MathematicalState(final String text, final boolean failure, final int code) {
 79  0 this.text = text;
 80  0 if (this.text == null) {
 81  0 throw new IllegalArgumentException("text==null");
 82    }
 83  0 this.failure = failure;
 84  0 this.code = code;
 85    }
 86   
 87    /**
 88    * Get meaning of module state.
 89    *
 90    * @return meaning of module state.
 91    */
 92  0 public final String getText() {
 93  0 return this.text;
 94    }
 95   
 96    /**
 97    * Is this a failure state?
 98    *
 99    * @return is this a failure state?
 100    */
 101  0 public final boolean isFailure() {
 102  0 return this.failure;
 103    }
 104   
 105    /**
 106    * Get module state code.
 107    *
 108    * @return Module state.
 109    */
 110  0 public final int getCode() {
 111  0 return this.code;
 112    }
 113   
 114    /* (non-Javadoc)
 115    * @see java.lang.Object#toString()
 116    */
 117  0 public final String toString() {
 118  0 return this.text;
 119    }
 120   
 121    /* (non-Javadoc)
 122    * @see java.lang.Object#hashCode()
 123    */
 124  0 public final int hashCode() {
 125  0 return this.text.hashCode();
 126    }
 127   
 128    /* (non-Javadoc)
 129    * @see java.lang.Object#equals(java.lang.Object)
 130    */
 131  0 public final boolean equals(final Object obj) {
 132  0 if (obj == null || !(obj instanceof MathematicalState)) {
 133  0 return false;
 134    }
 135  0 return text.equals(((MathematicalState) obj).text);
 136    }
 137   
 138    }