Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Jan 11 2007 09:03:50 CET
file stats: LOC: 102   Methods: 9
NCLOC: 41   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
AuthorVo.java 100% 100% 100% 100%
coverage
 1    /* $Id: AuthorVo.java,v 1.4 2006/10/20 20:23:01 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.dto.module;
 19   
 20    import org.qedeq.kernel.base.module.Author;
 21    import org.qedeq.kernel.base.module.Latex;
 22    import org.qedeq.kernel.utility.EqualsUtility;
 23   
 24   
 25    /**
 26    * Describes a specification of a module, that means its name, versions and
 27    * possible "physical" locations.
 28    *
 29    * @version $Revision: 1.4 $
 30    * @author Michael Meyling
 31    */
 32    public final class AuthorVo implements Author {
 33   
 34    /** Author name. */
 35    private Latex name;
 36   
 37    /** Email address of author. */
 38    private String email;
 39   
 40    /**
 41    * Constructs an author.
 42    *
 43    * @param name Author name.
 44    * @param email Author's email address.
 45    */
 46  26 public AuthorVo(final LatexVo name, final String email) {
 47  26 this.name = name;
 48  26 this.email = email;
 49    }
 50   
 51    /**
 52    * Constructs an empty author.
 53    */
 54  92 public AuthorVo() {
 55    // nothing to do
 56    }
 57   
 58    /**
 59    * Set name of author.
 60    *
 61    * @param name Author name.
 62    */
 63  79 public final void setName(final LatexVo name) {
 64  79 this.name = name;
 65    }
 66   
 67  659 public final Latex getName() {
 68  659 return name;
 69    }
 70   
 71    /**
 72    * Set author's email address.
 73    *
 74    * @param email Email address.
 75    */
 76  79 public final void setEmail(final String email) {
 77  79 this.email = email;
 78    }
 79   
 80  674 public final String getEmail() {
 81  674 return email;
 82    }
 83   
 84  141 public boolean equals(final Object obj) {
 85  141 if (!(obj instanceof AuthorVo)) {
 86  5 return false;
 87    }
 88  136 final AuthorVo other = (AuthorVo) obj;
 89  136 return EqualsUtility.equals(getName(), other.getName())
 90    && EqualsUtility.equals(getEmail(), other.getEmail());
 91    }
 92   
 93  124 public int hashCode() {
 94  124 return (getName() != null ? getName().hashCode() : 0)
 95  124 ^ (getEmail() != null ? 1 ^ getEmail().hashCode() : 0);
 96    }
 97   
 98  83 public String toString() {
 99  83 return getName() + (getEmail() != null ? "<" + getEmail() + ">" : "");
 100    }
 101   
 102    }