Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Jan 11 2007 09:03:50 CET
file stats: LOC: 152   Methods: 7
NCLOC: 62   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
QedeqBoState.java 50% 46,2% 28,6% 41,7%
coverage coverage
 1    /* $Id: QedeqBoState.java,v 1.2 2006/10/20 20:23:00 m31 Exp $
 2    *
 3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
 4    *
 5    * Copyright 2000-2006, 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 module state.
 23    *
 24    * @version $Revision: 1.2 $
 25    * @author Michael Meyling
 26    */
 27    public final class QedeqBoState {
 28   
 29    /** Creation phase. */
 30    public static final QedeqBoState STATE_CREATING
 31    = new QedeqBoState(ModuleConstants.STATE_STRING_CREATING,
 32    false, ModuleConstants.STATE_CODE_CREATING);
 33   
 34    /** Creation with errors. */
 35    public static final QedeqBoState STATE_CREATED_WITH_ERRORS
 36    = new QedeqBoState(ModuleConstants.STATE_STRING_CREATED_WITH_ERRORS,
 37    true, ModuleConstants.STATE_CODE_CREATED_WITH_ERRORS);
 38   
 39    /** Successfully created. */
 40    public static final QedeqBoState STATE_CREATED
 41    = new QedeqBoState(ModuleConstants.STATE_STRING_CREATED,
 42    false, ModuleConstants.STATE_CODE_CREATED);
 43   
 44    /** Internal checking phase. */
 45    public static final QedeqBoState STATE_INTERNAL_CHECKING
 46    = new QedeqBoState(ModuleConstants.STATE_STRING_INTERNAL_CHECKING,
 47    false, ModuleConstants.STATE_CODE_INTERNAL_CHECKING);
 48   
 49    /** Internal check failed. */
 50    public static final QedeqBoState STATE_INTERNAL_CHECK_FAILED
 51    = new QedeqBoState(ModuleConstants.STATE_STRING_INTERNAL_CHECK_FAILED,
 52    true, ModuleConstants.STATE_CODE_INTERNAL_CHECK_FAILED);
 53   
 54    /** Successfully internally checked. */
 55    public static final QedeqBoState STATE_INTERNALLY_CHECKED
 56    = new QedeqBoState(ModuleConstants.STATE_STRING_INTERNALLY_CHECKED,
 57    false, ModuleConstants.STATE_CODE_INTERNALLY_CHECKED);
 58   
 59    /** Complete checking phase. */
 60    public static final QedeqBoState STATE_COMPLETE_CHECKING
 61    = new QedeqBoState(ModuleConstants.STATE_STRING_COMPLETE_CHECKING,
 62    false, ModuleConstants.STATE_CODE_COMPLETE_CHECKING);
 63   
 64    /** Complete check failed. */
 65    public static final QedeqBoState STATE_CHECK_FAILED
 66    = new QedeqBoState(ModuleConstants.STATE_STRING_COMPLETE_CHECK_FAILED,
 67    true, ModuleConstants.STATE_CODE_COMPLETE_CHECK_FAILED);
 68   
 69    /** Successfully completely checked. */
 70    public static final QedeqBoState STATE_CHECKED
 71    = new QedeqBoState(ModuleConstants.STATE_STRING_COMPLETELY_CHECKED,
 72    false, ModuleConstants.STATE_CODE_COMPLETELY_CHECKED);
 73   
 74   
 75    /** meaning of this state. */
 76    private final String text;
 77   
 78    /** is this state a failure? */
 79    private final boolean failure;
 80   
 81    /** Code for state. */
 82    private final int code;
 83   
 84    /**
 85    * Creates new module state.
 86    *
 87    * @param text meaning of this state, <code>null</code> is not permitted.
 88    * @param failure is this a failure state?
 89    * @param code code of this state.
 90    * @throws IllegalArgumentException text == <code>null</code>
 91    */
 92  9 private QedeqBoState(final String text, final boolean failure, final int code) {
 93  9 this.text = text;
 94  9 if (this.text == null) {
 95  0 throw new IllegalArgumentException("text==null");
 96    }
 97  9 this.failure = failure;
 98  9 this.code = code;
 99    }
 100   
 101    /**
 102    * Get meaning of module state.
 103    *
 104    * @return meaning of module state.
 105    */
 106  0 public final String getText() {
 107  0 return this.text;
 108    }
 109   
 110    /**
 111    * Is this a failure state?
 112    *
 113    * @return is this a failure state?
 114    */
 115  0 public final boolean isFailure() {
 116  0 return this.failure;
 117    }
 118   
 119    /**
 120    * Get module state code.
 121    *
 122    * @return Module state.
 123    */
 124  0 public final int getCode() {
 125  0 return this.code;
 126    }
 127   
 128    /* (non-Javadoc)
 129    * @see java.lang.Object#toString()
 130    */
 131  0 public final String toString() {
 132  0 return this.text;
 133    }
 134   
 135    /* (non-Javadoc)
 136    * @see java.lang.Object#hashCode()
 137    */
 138  0 public final int hashCode() {
 139  0 return this.text.hashCode();
 140    }
 141   
 142    /* (non-Javadoc)
 143    * @see java.lang.Object#equals(java.lang.Object)
 144    */
 145  3 public final boolean equals(final Object obj) {
 146  3 if (obj == null || !(obj instanceof QedeqBoState)) {
 147  0 return false;
 148    }
 149  3 return text.equals(((QedeqBoState) obj).text);
 150    }
 151   
 152    }